Class: RoadForest::Testing::Produces

Inherits:
Object
  • Object
show all
Defined in:
lib/roadforest/test-support/matchers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#expectedObject (readonly)

Returns the value of attribute expected.



170
171
172
# File 'lib/roadforest/test-support/matchers.rb', line 170

def expected
  @expected
end

#infoObject (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 failure_message_for_should(actual)
  "Expected: #{expected.inspect}\n" +
  "Actual  : #{actual.inspect}\n" +
  "Processing results:\n#{info.join("\n")}"
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


172
173
174
# File 'lib/roadforest/test-support/matchers.rb', line 172

def matches?(actual)
  actual == expected
end