Class: TestTube::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/test_tube/base.rb

Overview

Abstract class representing the state of an experiment.

Direct Known Subclasses

Invoker, Passer

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#actual#object_id (readonly)

Expectation's actual value.

Returns:

  • (#object_id)

    The actual value.


9
10
11
# File 'lib/test_tube/base.rb', line 9

def actual
  @actual
end

#errorException? (readonly)

Expectation's raised error.

Returns:

  • (Exception, nil)

    The raised error.


14
15
16
# File 'lib/test_tube/base.rb', line 14

def error
  @error
end

#gotBoolean? (readonly)

Expectation's returned boolean value.

Returns:

  • (Boolean, nil)

    The returned boolean value.


19
20
21
# File 'lib/test_tube/base.rb', line 19

def got
  @got
end

Instance Method Details

#inspectString Also known as: to_s

A string containing a human-readable representation of the experiment.

Returns:

  • (String)

    The human-readable representation of the experiment.


24
25
26
# File 'lib/test_tube/base.rb', line 24

def inspect
  "<TestTube actual=#{actual.inspect} error=#{error.inspect} got=#{got.inspect}>"
end