Class: Mspec::Mocks::Allow

Inherits:
Object
  • Object
show all
Defined in:
lib/m-spec/mocks/allow.rb

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ Allow

Returns a new instance of Allow.



4
5
6
# File 'lib/m-spec/mocks/allow.rb', line 4

def initialize(obj)
  @obj = obj
end

Instance Method Details

#to(stub) ⇒ Object



8
9
10
# File 'lib/m-spec/mocks/allow.rb', line 8

def to(stub)
  @obj.define_singleton_method(stub.name) { stub.return_value }
end