Class: Lookout::Expect::Object

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

Overview

Expect block of Lookout::Expected::Objects. This is the base expect block class and may be subclassed if some special equality checking needs to be performed, if the execution environment needs to be set up in some way before the expect block is executed, or if the expect block should receive other arguments than the default (being the expected value).

Direct Known Subclasses

Classes::Exception, Exception

Defined Under Namespace

Classes: Context

Instance Method Summary collapse

Instance Method Details

#callResults::Error, ...

Evaluates the expect block and checks for differences between its result and the expected value.

Returns:

  • (Results::Error)

    If an Exception is raised

  • (Results::Success)

    If there are no differences between the actual result and the expected value

  • (Results::Failure)

    If there are differences between the actual result and the expected value



24
25
26
27
28
# File 'lib/lookout-3.0/expect/object.rb', line 24

def call
  check(evaluate_block)
rescue Exception => e
  Lookout::Results::Error.new(file, line, nil, Lookout::Exception.new(e))
end