Parent

Class/Module Index [+]

Quicksearch

Hpricot::Elem

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

Public Instance Methods

contain?(value) click to toggle source
# File lib/merb-core/test/test_ext/hpricot.rb, line 13
def contain?(value)
  self.inner_text.include?(value)
end
Also aliased as: contains?
contains?(value) click to toggle source
Alias for: contain?
inner_text() click to toggle source

courtesy of 'thomas' from the comments of _whys blog - get in touch if you want a better credit!

# File lib/merb-core/test/test_ext/hpricot.rb, line 27
def inner_text
  self.children.collect do |child|
    child.is_a?(Hpricot::Text) ? child.content : ((child.respond_to?("inner_text") && child.inner_text) || "")
  end.join.strip
end
match?(regex) click to toggle source
# File lib/merb-core/test/test_ext/hpricot.rb, line 19
def match?(regex)
  self.inner_text.match(regex)
end
Also aliased as: matches?
matches?(regex) click to toggle source
Alias for: match?

[Validate]

Generated with the Darkfish Rdoc Generator 2.