File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -259,6 +259,9 @@ def tag_name
259
259
260
260
def inspect
261
261
%x{
262
+ if (self[0] === document) return '#<Element [document]>'
263
+ else if (self[0] === window ) return '#<Element [window]>'
264
+
262
265
var val, el, str, result = [];
263
266
264
267
for (var i = 0, length = self.length; i < length; i++) {
Original file line number Diff line number Diff line change 7
7
< p id ="lol " class ="bar "> </ div >
8
8
HTML
9
9
10
- it "should return a string representation of the elements" do
10
+ it "returns a string representation of the elements" do
11
11
Element . find ( '#foo' ) . inspect . should == '#<Element [<div id="foo">]>'
12
12
Element . find ( '.bar' ) . inspect . should == '#<Element [<div class="bar">, <p id="lol" class="bar">]>'
13
13
end
14
14
15
- it "should return '[]' when called on empty element set" do
15
+ it "returns '[]' when called on empty element set" do
16
16
Element . find ( '.inspect-spec-none' ) . inspect . should == '#<Element []>'
17
17
end
18
+
19
+ it "returns '[]' when called on empty element set" do
20
+ Element . find ( '.inspect-spec-none' ) . inspect . should == '#<Element []>'
21
+ end
22
+
23
+ it "returns '[document]' when called on $(document)" do
24
+ Element . find ( `document` ) . inspect . should == '#<Element [document]>'
25
+ end
26
+
27
+ it "returns '[window]' when called on $(window)" do
28
+ Element . find ( `window` ) . inspect . should == '#<Element [window]>'
29
+ end
18
30
end
You can’t perform that action at this time.
0 commit comments