File tree 2 files changed +23
-2
lines changed
2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -228,15 +228,19 @@ def id=(value)
228
228
end
229
229
230
230
def inner_dom ( &block )
231
+ clear
232
+
231
233
# FIXME: when block passing is fixed
232
234
doc = document
233
- clear ; Builder . new ( doc , self , &block )
235
+ Builder . new ( doc , self , &block )
234
236
235
237
self
236
238
end
237
239
238
240
def inner_dom = ( node )
239
- clear ; self << node
241
+ clear
242
+
243
+ self << node
240
244
end
241
245
242
246
def /( *paths )
Original file line number Diff line number Diff line change 68
68
end
69
69
end
70
70
71
+ describe '#inner_dom' do
72
+ html <<-HTML
73
+ < div id ="lol ">
74
+ < div id ="wut "> </ div >
75
+ </ div >
76
+ HTML
77
+
78
+ it 'builds the DOM and inserts it' do
79
+ $document[ "lol" ] . inner_dom {
80
+ div . omg!
81
+ }
82
+
83
+ expect ( $document[ "#lol #omg" ] ) . to be_truthy
84
+ expect ( $document[ "#lol #wut" ] ) . to be_falsy
85
+ end
86
+ end
87
+
71
88
describe '#inspect' do
72
89
it 'uses the node name' do
73
90
el = $document. create_element ( 'div' )
You can’t perform that action at this time.
0 commit comments