Class: Lookout::Expected::Lookout::Output
- Defined in:
- lib/lookout-3.0/expected/lookout/output.rb
Overview
Represents expected Outputs.
Instance Method Summary collapse
-
#difference(actual) ⇒ Difference::Lookout::Output?
A difference report between ACTUAL and #expected unless they’re ‘#==`.
-
#expect(file, line) {|io| ... } ⇒ Expect::Lookout::Output
An expect block for the receiver at LINE in FILE that’ll yield an IO object that’ll expect to see the #expected output during the execution of the block.
Instance Method Details
#difference(actual) ⇒ Difference::Lookout::Output?
Returns A difference report between ACTUAL and #expected unless they’re ‘#==`.
22 23 24 25 |
# File 'lib/lookout-3.0/expected/lookout/output.rb', line 22 def difference(actual) Lookout::Difference::Lookout::Output.new(actual, expected) unless expected == actual end |
#expect(file, line) {|io| ... } ⇒ Expect::Lookout::Output
Returns An expect block for the receiver at LINE in FILE that’ll yield an IO object that’ll expect to see the #expected output during the execution of the block.
11 12 13 14 15 16 17 |
# File 'lib/lookout-3.0/expected/lookout/output.rb', line 11 def expect(file, line, &block) super(file, line){ |expected| output = StringIO.new block.call output expected.class.new(output.string) } end |