Class: RSpec::Steps::Step
- Inherits:
-
Struct
- Object
- Struct
- RSpec::Steps::Step
- Defined in:
- lib/rspec-steps/step.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#args ⇒ Object
Returns the value of attribute args.
-
#failed_step ⇒ Object
Returns the value of attribute failed_step.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
Instance Method Summary collapse
- #define_on(step_list, example_group) ⇒ Object
-
#initialize(*whatever) ⇒ Step
constructor
A new instance of Step.
- #run_inside(example, ex_obj) ⇒ Object
Constructor Details
#initialize(*whatever) ⇒ Step
Returns a new instance of Step.
3 4 5 6 |
# File 'lib/rspec-steps/step.rb', line 3 def initialize(*whatever) super @failed_step = nil end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action
2 3 4 |
# File 'lib/rspec-steps/step.rb', line 2 def action @action end |
#args ⇒ Object
Returns the value of attribute args
2 3 4 |
# File 'lib/rspec-steps/step.rb', line 2 def args @args end |
#failed_step ⇒ Object
Returns the value of attribute failed_step.
7 8 9 |
# File 'lib/rspec-steps/step.rb', line 7 def failed_step @failed_step end |
#metadata ⇒ Object
Returns the value of attribute metadata
2 3 4 |
# File 'lib/rspec-steps/step.rb', line 2 def @metadata end |
Instance Method Details
#define_on(step_list, example_group) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/rspec-steps/step.rb', line 9 def define_on(step_list, example_group) step = self example_group.it(*args, ) do |example| step_list.run_only_once(self, example) result = step_list.result_for(step) pending if result.is_after_failed_step? expect(result).to have_executed_successfully end end |
#run_inside(example, ex_obj) ⇒ Object
19 20 21 |
# File 'lib/rspec-steps/step.rb', line 19 def run_inside(example, ex_obj) example.instance_exec(ex_obj, &action) end |