Class: Lookout::Expected::Object

Inherits:
Object
  • Object
show all
Defined in:
lib/lookout-3.0/expected/object.rb

Overview

Represents expected Objects. This is the base expected-value class and may be subclassed if you have a type that would benefit from more specific treatment than what this class affords. Such a subclass should override #expect and/or #difference to set up type-specific expect blocks and/or difference checks and difference report generation.

Instance Method Summary collapse

Instance Method Details

#difference(actual) ⇒ Difference::Object?



27
28
29
# File 'lib/lookout-3.0/expected/object.rb', line 27

def difference(actual)
  Lookout::Difference::Object.new(actual, expected) unless expected == actual
end

#expect(file, line, &block) ⇒ Expect::Object



20
21
22
# File 'lib/lookout-3.0/expected/object.rb', line 20

def expect(file, line, &block)
  Lookout::Expect::Object.new(self, file, line, &block)
end