Class: RSpec::TagMatchers::HasTimeSelect
- Inherits:
-
MultipleInputMatcher
- Object
- MultipleInputMatcher
- RSpec::TagMatchers::HasTimeSelect
- Defined in:
- lib/rspec/tag_matchers/has_time_select.rb
Overview
A matcher that matches Rails’ time_select
drop-downs.
Instance Method Summary collapse
-
#description ⇒ String
Returns a description of the matcher’s criteria.
-
#failure_message ⇒ String
Returns an explanation of why the matcher failed to match with
should
. -
#initialize ⇒ HasTimeSelect
constructor
Initializes a HasTimeSelect matcher.
-
#negative_failure_message ⇒ String
Returns an explanation of why the matcher failed to match with
should_not
.
Methods inherited from MultipleInputMatcher
Constructor Details
#initialize ⇒ HasTimeSelect
Initializes a HasTimeSelect matcher.
18 19 20 |
# File 'lib/rspec/tag_matchers/has_time_select.rb', line 18 def initialize super('4i' => HasSelect.new, '5i' => HasSelect.new) end |
Instance Method Details
#description ⇒ String
Returns a description of the matcher’s criteria.
25 26 27 |
# File 'lib/rspec/tag_matchers/has_time_select.rb', line 25 def description [basic_description, extra_description].compact.join(" ") end |
#failure_message ⇒ String
Returns an explanation of why the matcher failed to match with should
.
32 33 34 |
# File 'lib/rspec/tag_matchers/has_time_select.rb', line 32 def "expected document to #{description}; got: #{@rendered}" end |
#negative_failure_message ⇒ String
Returns an explanation of why the matcher failed to match with should_not
.
39 40 41 |
# File 'lib/rspec/tag_matchers/has_time_select.rb', line 39 def "expected document to not #{description}; got: #{@rendered}" end |