Changeset 132
- Timestamp:
- 04/04/2007 00:12:24 (20 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
lib/hpricot/elements.rb (modified) (1 diff)
-
test/test_alter.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/hpricot/elements.rb
r130 r132 168 168 x.parent.replace_child(x, wrap) 169 169 nest = nest.children.first until nest.empty? 170 nest. children << x170 nest.html(nest.children + [x]) 171 171 end 172 172 end -
trunk/test/test_alter.rb
r112 r132 19 19 assert_equal 'test_inf.css', @basic.search("link")[-1].attributes['href'] 20 20 end 21 22 def test_wrap 23 @basic = Hpricot.parse(TestFiles::BASIC) 24 ohmy = (@basic/"p.ohmy").wrap("<div id='wrapper'></div>") 25 assert_equal 'wrapper', ohmy[0].parent['id'] 26 assert_equal 'ohmy', Hpricot(@basic.to_html).at("#wrapper").children[0]['class'] 27 end 21 28 end
