Class: ElabsMatchers::Matchers::HaveFlash::HaveFlashMatcher
- Inherits:
-
Struct
- Object
- Struct
- ElabsMatchers::Matchers::HaveFlash::HaveFlashMatcher
- Defined in:
- lib/elabs_matchers/matchers/have_flash.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #does_not_match?(page) ⇒ Boolean
- #failure_message ⇒ Object (also: #failure_message_for_should)
- #failure_message_when_negated ⇒ Object (also: #failure_message_for_should_not)
- #matches?(page) ⇒ Boolean
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message
8 9 10 |
# File 'lib/elabs_matchers/matchers/have_flash.rb', line 8 def @message end |
#page ⇒ Object (readonly)
Returns the value of attribute page
9 10 11 |
# File 'lib/elabs_matchers/matchers/have_flash.rb', line 9 def page @page end |
#type ⇒ Object
Returns the value of attribute type
8 9 10 |
# File 'lib/elabs_matchers/matchers/have_flash.rb', line 8 def type @type end |
Instance Method Details
#does_not_match?(page) ⇒ Boolean
16 17 18 19 |
# File 'lib/elabs_matchers/matchers/have_flash.rb', line 16 def does_not_match?(page) @page = page page.has_no_selector?(selector_type, selector, :text => ) end |
#failure_message ⇒ Object Also known as: failure_message_for_should
21 22 23 |
# File 'lib/elabs_matchers/matchers/have_flash.rb', line 21 def "Expected flash #{type} to be '#{}' but was '#{page.find(selector_type, selector).text}'." end |
#failure_message_when_negated ⇒ Object Also known as: failure_message_for_should_not
26 27 28 |
# File 'lib/elabs_matchers/matchers/have_flash.rb', line 26 def "Expected flash #{type} to not be '#{}' but it was." end |
#matches?(page) ⇒ Boolean
11 12 13 14 |
# File 'lib/elabs_matchers/matchers/have_flash.rb', line 11 def matches?(page) @page = page page.has_selector?(selector_type, selector, :text => ) end |