Class: RoadForest::Testing::Produces
- Inherits:
-
Object
- Object
- RoadForest::Testing::Produces
- Defined in:
- lib/roadforest/test-support/matchers.rb
Instance Attribute Summary collapse
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
Instance Method Summary collapse
- #failure_message_for_should(actual) ⇒ Object
-
#initialize(expected, info) ⇒ Produces
constructor
A new instance of Produces.
- #matches?(actual) ⇒ Boolean
Constructor Details
#initialize(expected, info) ⇒ Produces
Returns a new instance of Produces.
167 168 169 |
# File 'lib/roadforest/test-support/matchers.rb', line 167 def initialize(expected, info) @expected, @info = expected, info end |
Instance Attribute Details
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
170 171 172 |
# File 'lib/roadforest/test-support/matchers.rb', line 170 def expected @expected end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
170 171 172 |
# File 'lib/roadforest/test-support/matchers.rb', line 170 def info @info end |
Instance Method Details
#failure_message_for_should(actual) ⇒ Object
176 177 178 179 180 |
# File 'lib/roadforest/test-support/matchers.rb', line 176 def (actual) "Expected: #{expected.inspect}\n" + "Actual : #{actual.inspect}\n" + "Processing results:\n#{info.join("\n")}" end |
#matches?(actual) ⇒ Boolean
172 173 174 |
# File 'lib/roadforest/test-support/matchers.rb', line 172 def matches?(actual) actual == expected end |