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 @@ -319,17 +319,15 @@ def test_node_wrap
319
319
end
320
320
321
321
def test_node_wrap_uses_parent_node_as_parsing_context_node
322
- doc = Nokogiri . HTML5 ( "<html><body><select><option></option></select ></body></html>" )
323
- el = doc . at_css ( "option " )
322
+ doc = Nokogiri . HTML5 ( "<html><body><p></p ></body></html>" )
323
+ el = doc . at_css ( "p " )
324
324
325
- # fails to parse because `div` is not valid in the context of a `select` element
326
- exception = assert_raises ( RuntimeError ) { el . wrap ( "<div></div>" ) }
327
- assert_match ( /Failed to parse .* in the context of a 'select' element/ , exception . message )
325
+ exception = assert_raises ( RuntimeError ) { el . wrap ( "<html></html>" ) }
326
+ assert_match ( /Failed to parse .* in the context of a 'body' element/ , exception . message )
328
327
329
- # parses because `optgroup` is valid in the context of a `select` element
330
- el . wrap ( "<optgroup></optgroup>" )
331
- assert_equal ( "optgroup" , el . parent . name )
332
- assert_equal ( "select" , el . parent . parent . name )
328
+ el . wrap ( "<div></div>" )
329
+ assert_equal ( "div" , el . parent . name )
330
+ assert_equal ( "body" , el . parent . parent . name )
333
331
end
334
332
335
333
def test_parse_in_context_of_foreign_namespace
You can’t perform that action at this time.
0 commit comments