Class: RSpec::Stepwise::Context Private
- Inherits:
-
Object
- Object
- RSpec::Stepwise::Context
- Defined in:
- lib/rspec/stepwise.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#initialize(klass) ⇒ Context
constructor
private
A new instance of Context.
- #previous_failed? ⇒ Boolean private
- #run(&block) ⇒ Object private
- #run_step(&block) ⇒ Object private
Constructor Details
#initialize(klass) ⇒ Context
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Context.
114 115 116 117 |
# File 'lib/rspec/stepwise.rb', line 114 def initialize(klass) @context = klass.new @previous_failed = false end |
Instance Method Details
#previous_failed? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
130 131 132 |
# File 'lib/rspec/stepwise.rb', line 130 def previous_failed? @previous_failed end |
#run(&block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
126 127 128 |
# File 'lib/rspec/stepwise.rb', line 126 def run(&block) @context.instance_eval(&block) end |
#run_step(&block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
119 120 121 122 123 124 |
# File 'lib/rspec/stepwise.rb', line 119 def run_step(&block) run(&block) rescue @previous_failed = true raise end |