Class: Shoulda::ActionController::Matchers::SetTheFlashMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/shoulda/action_controller/matchers/set_the_flash_matcher.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#failure_messageObject (readonly)

Returns the value of attribute failure_message.



30
31
32
# File 'lib/shoulda/action_controller/matchers/set_the_flash_matcher.rb', line 30

def failure_message
  @failure_message
end

#negative_failure_messageObject (readonly)

Returns the value of attribute negative_failure_message.



30
31
32
# File 'lib/shoulda/action_controller/matchers/set_the_flash_matcher.rb', line 30

def negative_failure_message
  @negative_failure_message
end

Instance Method Details

#descriptionObject



32
33
34
35
36
# File 'lib/shoulda/action_controller/matchers/set_the_flash_matcher.rb', line 32

def description
  description = "set the flash"
  description << " to #{@value.inspect}" unless @value.nil?
  description
end

#matches?(controller) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
28
# File 'lib/shoulda/action_controller/matchers/set_the_flash_matcher.rb', line 25

def matches?(controller)
  @controller = controller
  sets_the_flash? && string_value_matches? && regexp_value_matches?
end

#to(value) ⇒ Object



20
21
22
23
# File 'lib/shoulda/action_controller/matchers/set_the_flash_matcher.rb', line 20

def to(value)
  @value = value
  self
end