Class: ProtoPharm::RSpec::ActionStubProxy
- Inherits:
-
Object
- Object
- ProtoPharm::RSpec::ActionStubProxy
- Defined in:
- lib/proto_pharm/rspec/action_stub_proxy.rb
Defined Under Namespace
Classes: Expectation
Instance Attribute Summary collapse
-
#expectations ⇒ Object
readonly
Returns the value of attribute expectations.
-
#rpc_action ⇒ Object
readonly
Returns the value of attribute rpc_action.
Instance Method Summary collapse
- #and_fail ⇒ Object
-
#and_fail_with(*args, **kwargs) ⇒ Object
Proxies ActionStub#to_fail_with.
-
#and_raise(*args, **kwargs) ⇒ Object
Proxies ActionStub#to_raise.
-
#and_return(*args, **kwargs) ⇒ Object
Proxies ActionStub#to_return.
-
#initialize(rpc_action) ⇒ ActionStubProxy
constructor
A new instance of ActionStubProxy.
-
#with(*args, **kwargs) ⇒ Object
Proxies ActionStub#with.
Constructor Details
#initialize(rpc_action) ⇒ ActionStubProxy
Returns a new instance of ActionStubProxy.
8 9 10 11 |
# File 'lib/proto_pharm/rspec/action_stub_proxy.rb', line 8 def initialize(rpc_action) @rpc_action = rpc_action @expectations = [] end |
Instance Attribute Details
#expectations ⇒ Object (readonly)
Returns the value of attribute expectations.
6 7 8 |
# File 'lib/proto_pharm/rspec/action_stub_proxy.rb', line 6 def expectations @expectations end |
#rpc_action ⇒ Object (readonly)
Returns the value of attribute rpc_action.
6 7 8 |
# File 'lib/proto_pharm/rspec/action_stub_proxy.rb', line 6 def rpc_action @rpc_action end |
Instance Method Details
#and_fail ⇒ Object
41 42 43 44 45 |
# File 'lib/proto_pharm/rspec/action_stub_proxy.rb', line 41 def and_fail expectations << Expectation.new(:to_fail, [], {}) self end |
#and_fail_with(*args, **kwargs) ⇒ Object
Proxies ActionStub#to_fail_with
35 36 37 38 39 |
# File 'lib/proto_pharm/rspec/action_stub_proxy.rb', line 35 def and_fail_with(*args, **kwargs) expectations << Expectation.new(:to_fail_with, args, kwargs) self end |
#and_raise(*args, **kwargs) ⇒ Object
Proxies ActionStub#to_raise
28 29 30 31 32 |
# File 'lib/proto_pharm/rspec/action_stub_proxy.rb', line 28 def and_raise(*args, **kwargs) expectations << Expectation.new(:to_raise, args, kwargs) self end |
#and_return(*args, **kwargs) ⇒ Object
Proxies ActionStub#to_return
21 22 23 24 25 |
# File 'lib/proto_pharm/rspec/action_stub_proxy.rb', line 21 def and_return(*args, **kwargs) expectations << Expectation.new(:to_return, args, kwargs) self end |
#with(*args, **kwargs) ⇒ Object
Proxies ActionStub#with
14 15 16 17 18 |
# File 'lib/proto_pharm/rspec/action_stub_proxy.rb', line 14 def with(*args, **kwargs) expectations << Expectation.new(:with, args, kwargs) self end |