Class: Merb::Test::Rspec::ControllerMatchers::BeError
- Defined in:
- lib/merb-core/test/matchers/controller_matchers.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(expected) ⇒ BeError
constructor
A new instance of BeError.
- #matches?(target) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(expected) ⇒ BeError
Returns a new instance of BeError.
35 36 37 |
# File 'lib/merb-core/test/matchers/controller_matchers.rb', line 35 def initialize(expected) @expected = expected end |
Instance Method Details
#failure_message ⇒ Object
45 46 47 48 |
# File 'lib/merb-core/test/matchers/controller_matchers.rb', line 45 def "expected #{@target} to be a #{@expected} error, but it was " << @target.request.exceptions.first.inspect end |
#matches?(target) ⇒ Boolean
39 40 41 42 43 |
# File 'lib/merb-core/test/matchers/controller_matchers.rb', line 39 def matches?(target) @target = target @target.request.exceptions && @target.request.exceptions.first.is_a?(@expected) end |
#negative_failure_message ⇒ Object
50 51 52 |
# File 'lib/merb-core/test/matchers/controller_matchers.rb', line 50 def "expected #{@target} not to be a #{@expected} error, but it was" end |