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 ⇒ Object (also: #failure_message_for_should)
- #failure_message_when_negated ⇒ Object (also: #failure_message_for_should_not)
-
#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.
81 82 83 |
# File 'lib/capybara/rspec/matchers.rb', line 81 def initialize(title) @title = title end |
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
79 80 81 |
# File 'lib/capybara/rspec/matchers.rb', line 79 def title @title end |
Instance Method Details
#description ⇒ Object
107 108 109 |
# File 'lib/capybara/rspec/matchers.rb', line 107 def description "have title #{title.inspect}" end |
#does_not_match?(actual) ⇒ Boolean
90 91 92 93 |
# File 'lib/capybara/rspec/matchers.rb', line 90 def does_not_match?(actual) @actual = wrap(actual) @actual.has_no_title?(title) end |
#failure_message ⇒ Object Also known as: failure_message_for_should
95 96 97 |
# File 'lib/capybara/rspec/matchers.rb', line 95 def "expected there to be title #{title.inspect} in #{@actual.title.inspect}" end |
#failure_message_when_negated ⇒ Object Also known as: failure_message_for_should_not
99 100 101 |
# File 'lib/capybara/rspec/matchers.rb', line 99 def "expected there not to be title #{title.inspect} in #{@actual.title.inspect}" end |
#matches?(actual) ⇒ Boolean
85 86 87 88 |
# File 'lib/capybara/rspec/matchers.rb', line 85 def matches?(actual) @actual = wrap(actual) @actual.has_title?(title) end |