Class: Mspec::Mocks::Allow
- Inherits:
-
Object
- Object
- Mspec::Mocks::Allow
- Defined in:
- lib/m-spec/mocks/allow.rb
Instance Method Summary collapse
-
#initialize(obj) ⇒ Allow
constructor
A new instance of Allow.
- #to(stub) ⇒ Object
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 |