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.



36
37
38
# File 'lib/shoulda/action_controller/matchers/set_the_flash_matcher.rb', line 36

def failure_message
  @failure_message
end

#negative_failure_messageObject (readonly)

Returns the value of attribute negative_failure_message.



36
37
38
# File 'lib/shoulda/action_controller/matchers/set_the_flash_matcher.rb', line 36

def negative_failure_message
  @negative_failure_message
end

Instance Method Details

#descriptionObject



38
39
40
41
42
# File 'lib/shoulda/action_controller/matchers/set_the_flash_matcher.rb', line 38

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

#matches?(controller) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#nowObject



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

def now
  @now = true
  self
end

#to(value) ⇒ Object



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

def to(value)
  @value = value
  self
end