Class: ExpectsChain::Mockers::Mocha
- Inherits:
-
Base
show all
- Defined in:
- lib/expects_chain/mockers/mocha.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #with
Class Method Details
22
23
24
|
# File 'lib/expects_chain/mockers/mocha.rb', line 22
def self.mock
::Mocha::Mock.new(nil)
end
|
26
27
28
|
# File 'lib/expects_chain/mockers/mocha.rb', line 26
def self.stub
::Mocha::Mock.new(nil)
end
|
Instance Method Details
#expects(method) ⇒ Object
4
5
6
7
|
# File 'lib/expects_chain/mockers/mocha.rb', line 4
def expects method
@object = @object.expects(method).at_least_once
self
end
|
#raises(ex) ⇒ Object
18
19
20
|
# File 'lib/expects_chain/mockers/mocha.rb', line 18
def raises ex
@object.raises(generate_exception(ex))
end
|
#returns(ret) ⇒ Object
14
15
16
|
# File 'lib/expects_chain/mockers/mocha.rb', line 14
def returns ret
@object = @object.returns(ret)
end
|
#stubs(method) ⇒ Object
9
10
11
12
|
# File 'lib/expects_chain/mockers/mocha.rb', line 9
def stubs method
@object = @object.stubs(method)
self
end
|