| Class | Hpricot::Elem |
| In: |
merb-core/lib/merb-core/test/test_ext/hpricot.rb
|
| Parent: | Object |
yehudakatz.com/2007/01/27/a-better-assert_select-assert_elements/ based on assert_elements Author: Yehuda Katz Email: wycats @nospam@ gmail.com Web: www.yehudakatz.com
which was based on HpricotTestHelper Author: Luke Redpath Email: contact @nospam@ lukeredpath.co.uk Web: www.lukeredpath.co.uk / opensource.agileevolved.com
# File merb-core/lib/merb-core/test/test_ext/hpricot.rb, line 13
13: def contain?(value)
14: self.inner_text.include?(value)
15: end
courtesy of ‘thomas’ from the comments of _whys blog - get in touch if you want a better credit!
# File merb-core/lib/merb-core/test/test_ext/hpricot.rb, line 27
27: def inner_text
28: self.children.collect do |child|
29: child.is_a?(Hpricot::Text) ? child.content : ((child.respond_to?("inner_text") && child.inner_text) || "")
30: end.join.strip
31: end