Class: RubyReactor::RSpec::TestSubject::StepProxy
- Inherits:
-
Object
- Object
- RubyReactor::RSpec::TestSubject::StepProxy
- Defined in:
- lib/ruby_reactor/rspec/test_subject.rb
Overview
Proxy class for fluent mocking configuration
Instance Method Summary collapse
- #composed(inner_step_name) ⇒ Object
-
#initialize(subject, step_name) ⇒ StepProxy
constructor
A new instance of StepProxy.
-
#map(inner_step_name) ⇒ Object
Support deep nesting?.
- #mock_step(inner_step_name, *nested_steps, &block) ⇒ Object
Constructor Details
#initialize(subject, step_name) ⇒ StepProxy
Returns a new instance of StepProxy.
72 73 74 75 |
# File 'lib/ruby_reactor/rspec/test_subject.rb', line 72 def initialize(subject, step_name) @subject = subject @step_name = step_name end |
Instance Method Details
#composed(inner_step_name) ⇒ Object
87 88 89 |
# File 'lib/ruby_reactor/rspec/test_subject.rb', line 87 def composed(inner_step_name) StepProxy.new(@subject, [@step_name, inner_step_name].flatten) end |
#map(inner_step_name) ⇒ Object
Support deep nesting?
83 84 85 |
# File 'lib/ruby_reactor/rspec/test_subject.rb', line 83 def map(inner_step_name) StepProxy.new(@subject, [@step_name, inner_step_name].flatten) end |
#mock_step(inner_step_name, *nested_steps, &block) ⇒ Object
77 78 79 80 |
# File 'lib/ruby_reactor/rspec/test_subject.rb', line 77 def mock_step(inner_step_name, *nested_steps, &block) @subject.mock_step(@step_name, inner_step_name, *nested_steps, &block) @subject # Return subject to allow chaining or calling run end |