struct Spectator::Mocks::Allow(T)

Overview

Wrapper for stubbable objects to use in the "allow" syntax.

Defined in:

spectator/mocks/allow.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(proxy : Proxy(T)) #

Creates the wrapper. Takes a proxy from the stubbable object.


[View source]

Instance Method Detail

def to(stub : Stub) #

DSL method to apply a stub.

allow(dbl).to receive(:foo)

[View source]
def to(collection : StubCollection) #

DSL method to apply a collection of stubs.

allow(dbl).to receive(answer: 42, foo: "bar")

[View source]