Class: Evil::Client::RSpec::AllowStub
- Defined in:
- lib/evil/client/rspec/allow_stub.rb
Overview
Container to chain settings for allowing operation(s)
Instance Method Summary collapse
- #to_call_original ⇒ Object
- #to_raise(error = StandardError, *args) ⇒ Object
- #to_return(response = nil) ⇒ Object
Methods inherited from BaseStub
Instance Method Details
#to_call_original ⇒ Object
19 20 21 22 23 |
# File 'lib/evil/client/rspec/allow_stub.rb', line 19 def to_call_original allow(Evil::Client::Container::Operation) .to follow_expectation .and_call_original end |
#to_raise(error = StandardError, *args) ⇒ Object
13 14 15 16 17 |
# File 'lib/evil/client/rspec/allow_stub.rb', line 13 def to_raise(error = StandardError, *args) allow(Evil::Client::Container::Operation) .to follow_expectation .and_return proc { raise(error, *args) } end |
#to_return(response = nil) ⇒ Object
7 8 9 10 11 |
# File 'lib/evil/client/rspec/allow_stub.rb', line 7 def to_return(response = nil) allow(Evil::Client::Container::Operation) .to follow_expectation .and_return double(:operation, call: response) end |