Class: RSpec::TagMatchers::HasTimeSelect

Inherits:
MultipleInputMatcher show all
Defined in:
lib/rspec/tag_matchers/has_time_select.rb

Overview

A matcher that matches Rails’ time_select drop-downs.

Instance Method Summary collapse

Methods inherited from MultipleInputMatcher

#for, #matches?

Constructor Details

#initializeHasTimeSelect

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

#descriptionString

Returns a description of the matcher’s criteria.

Returns:

  • (String)


25
26
27
# File 'lib/rspec/tag_matchers/has_time_select.rb', line 25

def description
  [basic_description, extra_description].compact.join(" ")
end

#failure_messageString

Returns an explanation of why the matcher failed to match with should.

Returns:

  • (String)


32
33
34
# File 'lib/rspec/tag_matchers/has_time_select.rb', line 32

def failure_message
  "expected document to #{description}; got: #{@rendered}"
end

#negative_failure_messageString

Returns an explanation of why the matcher failed to match with should_not.

Returns:

  • (String)


39
40
41
# File 'lib/rspec/tag_matchers/has_time_select.rb', line 39

def negative_failure_message
  "expected document to not #{description}; got: #{@rendered}"
end