Class: Capybara::RSpecMatchers::HaveTitle
- Defined in:
- lib/capybara/rspec/matchers.rb
Instance Attribute Summary collapse
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #description ⇒ Object
- #does_not_match?(actual) ⇒ Boolean
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
-
#initialize(title) ⇒ HaveTitle
constructor
A new instance of HaveTitle.
- #matches?(actual) ⇒ Boolean
Methods inherited from Matcher
Constructor Details
#initialize(title) ⇒ HaveTitle
Returns a new instance of HaveTitle.
77 78 79 |
# File 'lib/capybara/rspec/matchers.rb', line 77 def initialize(title) @title = title end |
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
75 76 77 |
# File 'lib/capybara/rspec/matchers.rb', line 75 def title @title end |
Instance Method Details
#description ⇒ Object
99 100 101 |
# File 'lib/capybara/rspec/matchers.rb', line 99 def description "have title #{title.inspect}" end |
#does_not_match?(actual) ⇒ Boolean
86 87 88 89 |
# File 'lib/capybara/rspec/matchers.rb', line 86 def does_not_match?(actual) @actual = wrap(actual) @actual.has_no_title?(title) end |
#failure_message_for_should ⇒ Object
91 92 93 |
# File 'lib/capybara/rspec/matchers.rb', line 91 def "expected there to be title #{title.inspect} in #{@actual.title.inspect}" end |
#failure_message_for_should_not ⇒ Object
95 96 97 |
# File 'lib/capybara/rspec/matchers.rb', line 95 def "expected there not to be title #{title.inspect} in #{@actual.title.inspect}" end |
#matches?(actual) ⇒ Boolean
81 82 83 84 |
# File 'lib/capybara/rspec/matchers.rb', line 81 def matches?(actual) @actual = wrap(actual) @actual.has_title?(title) end |