Class: Lookout::Actual

Inherits:
Aphonic show all
Defined in:
lib/lookout-3.0/actual.rb

Overview

Stands in for the actual result of the expect block, allowing a query method to call on the actual result to be set up and checked after the expect block returns. Used by Expectations::Context#result.

Direct Known Subclasses

Not

Defined Under Namespace

Classes: Method, Not

Constant Summary

Constants inherited from Aphonic

Lookout::Aphonic::Methods

Instance Method Summary collapse

Methods inherited from Aphonic

silence

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Method (private)

Returns A method wrapper that’ll call METHOD with ARGS and BLOCK when called.

Returns:

  • (Method)

    A method wrapper that’ll call METHOD with ARGS and BLOCK when called



29
# File 'lib/lookout-3.0/actual.rb', line 29

def method_missing(method, *args, &block) Method.new(method, *args, &block) end

Instance Method Details

#beself

Method for improving readability of query method set-up.

Returns:

  • (self)


18
# File 'lib/lookout-3.0/actual.rb', line 18

def be; self end

#haveself

Method for improving readability of query method set-up.

Returns:

  • (self)


22
# File 'lib/lookout-3.0/actual.rb', line 22

def have; self end

#notActual::Not

Returns A result stand-in that’s the inversion of the receiver.

Returns:

  • (Actual::Not)

    A result stand-in that’s the inversion of the receiver



10
# File 'lib/lookout-3.0/actual.rb', line 10

def not; Lookout::Actual::Not.new end

#toself

Method for improving readability of query method set-up.

Returns:

  • (self)


14
# File 'lib/lookout-3.0/actual.rb', line 14

def to; self end