File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -294,17 +294,15 @@ def test_node_wrap
294
294
end
295
295
296
296
def test_node_wrap_uses_parent_node_as_parsing_context_node
297
- doc = Nokogiri . HTML5 ( "<html><body><select><option></option></select ></body></html>" )
298
- el = doc . at_css ( "option " )
297
+ doc = Nokogiri . HTML5 ( "<html><body><p></p ></body></html>" )
298
+ el = doc . at_css ( "p " )
299
299
300
- # fails to parse because `div` is not valid in the context of a `select` element
301
- exception = assert_raises ( RuntimeError ) { el . wrap ( "<div></div>" ) }
302
- assert_match ( /Failed to parse .* in the context of a 'select' element/ , exception . message )
300
+ exception = assert_raises ( RuntimeError ) { el . wrap ( "<html></html>" ) }
301
+ assert_match ( /Failed to parse .* in the context of a 'body' element/ , exception . message )
303
302
304
- # parses because `optgroup` is valid in the context of a `select` element
305
- el . wrap ( "<optgroup></optgroup>" )
306
- assert_equal ( "optgroup" , el . parent . name )
307
- assert_equal ( "select" , el . parent . parent . name )
303
+ el . wrap ( "<div></div>" )
304
+ assert_equal ( "div" , el . parent . name )
305
+ assert_equal ( "body" , el . parent . parent . name )
308
306
end
309
307
310
308
def test_parse_in_context_of_foreign_namespace
You can’t perform that action at this time.
0 commit comments