Class: RSpec::Steps::Hook
- Inherits:
-
Struct
- Object
- Struct
- RSpec::Steps::Hook
- Defined in:
- lib/rspec-steps/hook.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action
4 5 6 |
# File 'lib/rspec-steps/hook.rb', line 4 def action @action end |
#kind ⇒ Object
Returns the value of attribute kind
4 5 6 |
# File 'lib/rspec-steps/hook.rb', line 4 def kind @kind end |
#type ⇒ Object
Returns the value of attribute type
4 5 6 |
# File 'lib/rspec-steps/hook.rb', line 4 def type @type end |
Instance Method Details
#define_on(example_group) ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/rspec-steps/hook.rb', line 23 def define_on(example_group) case type when :before example_group.before rspec_kind, &action when :after example_group.after rspec_kind, &action when :around example_group.around rspec_kind, &action end end |
#rspec_kind ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/rspec-steps/hook.rb', line 5 def rspec_kind case kind when :each warn_about_promotion(type) :all when :step :each else kind end end |