Class: Spinach::Hooks
Overview
Spinach's hooks is a subscription mechanism to allow developers to define certain callbacks given several Spinach signals, like running a feature, executing a particular step and such.
Instance Method Summary (collapse)
-
- (Object) after_feature
Runs after every feature.
-
- (Object) after_run
Runs after the entire spinach run.
-
- (Object) after_scenario
Runs after every scenario.
-
- (Object) after_step
Runs after every step execution.
-
- (Object) around_scenario
Runs around every scenario.
-
- (Object) before_feature
Runs before every feature,.
-
- (Object) before_run
Runs before the entire spinach run.
-
- (Object) before_scenario
Runs before every scenario.
-
- (Object) before_step
Runs before every step execution.
-
- (Object) on_error_step
Runs after every step execution that raises an exception.
-
- (Object) on_failed_step
Runs after every failed step execution.
-
- (Object) on_skipped_step
Runs every time a step is skipped because there has been an unsuccessful one just before.
-
- (Object) on_successful_step
Runs after every successful step execution.
-
- (Object) on_tag(tag)
Runs before running a scenario with a particular tag.
-
- (Object) on_undefined_feature
Runs when an undefined feature is found.
-
- (Object) on_undefined_step
Runs every time a step which is not defined is called.
Methods included from Hookable
Instance Method Details
- (Object) after_feature
Runs after every feature
40 |
# File 'lib/spinach/hooks.rb', line 40 hook :after_feature |
- (Object) after_run
Runs after the entire spinach run
24 |
# File 'lib/spinach/hooks.rb', line 24 hook :after_run |
- (Object) after_scenario
Runs after every scenario
73 |
# File 'lib/spinach/hooks.rb', line 73 hook :after_scenario |
- (Object) after_step
Runs after every step execution
89 |
# File 'lib/spinach/hooks.rb', line 89 hook :after_step |
- (Object) around_scenario
Runs around every scenario
65 |
# File 'lib/spinach/hooks.rb', line 65 hook :around_scenario |
- (Object) before_feature
Runs before every feature,
32 |
# File 'lib/spinach/hooks.rb', line 32 hook :before_feature |
- (Object) before_run
Runs before the entire spinach run
16 |
# File 'lib/spinach/hooks.rb', line 16 hook :before_run |
- (Object) before_scenario
Runs before every scenario
57 |
# File 'lib/spinach/hooks.rb', line 57 hook :before_scenario |
- (Object) before_step
Runs before every step execution
81 |
# File 'lib/spinach/hooks.rb', line 81 hook :before_step |
- (Object) on_error_step
Runs after every step execution that raises an exception
119 |
# File 'lib/spinach/hooks.rb', line 119 hook :on_error_step |
- (Object) on_failed_step
Runs after every failed step execution
109 |
# File 'lib/spinach/hooks.rb', line 109 hook :on_failed_step |
- (Object) on_skipped_step
Runs every time a step is skipped because there has been an unsuccessful one just before.
138 |
# File 'lib/spinach/hooks.rb', line 138 hook :on_skipped_step |
- (Object) on_successful_step
Runs after every successful step execution
99 |
# File 'lib/spinach/hooks.rb', line 99 hook :on_successful_step |
- (Object) on_tag(tag)
Runs before running a scenario with a particular tag
149 150 151 152 153 154 155 |
# File 'lib/spinach/hooks.rb', line 149 def on_tag(tag) before_scenario do |scenario| = scenario. next unless .any? yield(scenario) if .include? tag.to_s end end |
- (Object) on_undefined_feature
Runs when an undefined feature is found
49 |
# File 'lib/spinach/hooks.rb', line 49 hook :on_undefined_feature |
- (Object) on_undefined_step
Runs every time a step which is not defined is called
129 |
# File 'lib/spinach/hooks.rb', line 129 hook :on_undefined_step |