Class: Lookout::Object::Not::Receive

Inherits:
Aphonic show all
Defined in:
lib/lookout-3.0/object/not/receive.rb

Overview

The “not to receive” keywords on Objects.

Constant Summary

Constants inherited from Aphonic

Aphonic::Methods

Instance Method Summary collapse

Methods inherited from Aphonic

silence

Constructor Details

#initialize(object) ⇒ Receive

Stands in for OBJECT, allowing a Reception exception that expects the given method never to be called to be set up.

Parameters:



8
# File 'lib/lookout-3.0/object/not/receive.rb', line 8

def initialize(object) @object = object end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &body) ⇒ Reception (private)

Returns A method reception expectation on the object that expects METHOD never to be called.

Returns:

  • (Reception)

    A method reception expectation on the object that expects METHOD never to be called



15
16
17
# File 'lib/lookout-3.0/object/not/receive.rb', line 15

def method_missing(method, *args, &body)
  Lookout::Reception.of(@object, method, *args, &body).never
end