Class: Xpath::Specs::ContainA
- Inherits:
-
Object
- Object
- Xpath::Specs::ContainA
- Defined in:
- lib/xpath/specs/contain_a_matcher.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
-
#initialize(page_part) ⇒ ContainA
constructor
A new instance of ContainA.
- #matches?(page) ⇒ Boolean
Constructor Details
#initialize(page_part) ⇒ ContainA
Returns a new instance of ContainA.
7 8 9 |
# File 'lib/xpath/specs/contain_a_matcher.rb', line 7 def initialize(page_part) @page_part = page_part end |
Instance Method Details
#description ⇒ Object
24 25 26 |
# File 'lib/xpath/specs/contain_a_matcher.rb', line 24 def description "expected the page to contain #{@page_part.long_description}" end |
#failure_message_for_should ⇒ Object
16 17 18 |
# File 'lib/xpath/specs/contain_a_matcher.rb', line 16 def (@page_part) end |
#failure_message_for_should_not ⇒ Object
20 21 22 |
# File 'lib/xpath/specs/contain_a_matcher.rb', line 20 def "expected the page not to contain #{@page_part.long_description})" end |
#matches?(page) ⇒ Boolean
11 12 13 14 |
# File 'lib/xpath/specs/contain_a_matcher.rb', line 11 def matches?(page) @doc = Nokogiri::HTML(body_of(page)) doc_contains(@page_part) end |