Parent

Class/Module Index [+]

Quicksearch

Shoulda::Matchers::ActionController::SetTheFlashMatcher

@private

Public Class Methods

new() click to toggle source
# File lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb, line 154
def initialize
  @options = {}
  @value = nil
end

Public Instance Methods

[](key) click to toggle source
# File lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb, line 172
def [](key)
  @options[:key] = key
  self
end
description() click to toggle source
# File lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb, line 182
def description
  description = "set the #{expected_flash_invocation}"
  description << " to #{@value.inspect}" unless @value.nil?
  description
end
failure_message() click to toggle source
# File lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb, line 188
def failure_message
  "Expected #{expectation}"
end
Also aliased as: failure_message_for_should
failure_message_for_should() click to toggle source
Alias for: failure_message
failure_message_for_should_not() click to toggle source
failure_message_when_negated() click to toggle source
# File lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb, line 193
def failure_message_when_negated
  "Did not expect #{expectation}"
end
matches?(controller) click to toggle source
# File lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb, line 177
def matches?(controller)
  @controller = controller
  sets_the_flash? && string_value_matches? && regexp_value_matches?
end
now() click to toggle source
# File lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb, line 167
def now
  @options[:now] = true
  self
end
to(value) click to toggle source
# File lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb, line 159
def to(value)
  if !value.is_a?(String) && !value.is_a?(Regexp)
    raise "cannot match against #{value.inspect}"
  end
  @value = value
  self
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.