Class: ProtoPharm::RSpec::ActionStubProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/proto_pharm/rspec/action_stub_proxy.rb

Defined Under Namespace

Classes: Expectation

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#expectationsObject (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_actionObject (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_failObject



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