@@ -19,8 +19,8 @@ def build_rb_world_factory(world_modules, namespaced_world_modules, proc)
1919 @rb_language . build_rb_world_factory ( world_modules , namespaced_world_modules , proc )
2020 end
2121
22- def register_rb_hook ( phase , tag_names , proc )
23- @rb_language . register_rb_hook ( phase , tag_names , proc )
22+ def register_rb_hook ( phase , tag_names , proc , name : nil )
23+ @rb_language . register_rb_hook ( phase , tag_names , proc , name : name )
2424 end
2525
2626 def define_parameter_type ( parameter_type )
@@ -62,29 +62,29 @@ def World(*world_modules, **namespaced_world_modules, &proc)
6262
6363 # Registers a proc that will run before each Scenario. You can register as many
6464 # as you want (typically from ruby scripts under <tt>support/hooks.rb</tt>).
65- def Before ( *tag_expressions , &proc )
66- Dsl . register_rb_hook ( 'before' , tag_expressions , proc )
65+ def Before ( *tag_expressions , name : nil , &proc )
66+ Dsl . register_rb_hook ( 'before' , tag_expressions , proc , name : name )
6767 end
6868
6969 # Registers a proc that will run after each Scenario. You can register as many
7070 # as you want (typically from ruby scripts under <tt>support/hooks.rb</tt>).
71- def After ( *tag_expressions , &proc )
72- Dsl . register_rb_hook ( 'after' , tag_expressions , proc )
71+ def After ( *tag_expressions , name : nil , &proc )
72+ Dsl . register_rb_hook ( 'after' , tag_expressions , proc , name : name )
7373 end
7474
7575 # Registers a proc that will be wrapped around each scenario. The proc
7676 # should accept two arguments: two arguments: the scenario and a "block"
7777 # argument (but passed as a regular argument, since blocks cannot accept
7878 # blocks in 1.8), on which it should call the .call method. You can register
7979 # as many as you want (typically from ruby scripts under <tt>support/hooks.rb</tt>).
80- def Around ( *tag_expressions , &proc )
81- Dsl . register_rb_hook ( 'around' , tag_expressions , proc )
80+ def Around ( *tag_expressions , name : nil , &proc )
81+ Dsl . register_rb_hook ( 'around' , tag_expressions , proc , name : name )
8282 end
8383
8484 # Registers a proc that will run after each Step. You can register as
8585 # as you want (typically from ruby scripts under <tt>support/hooks.rb</tt>).
86- def AfterStep ( *tag_expressions , &proc )
87- Dsl . register_rb_hook ( 'after_step' , tag_expressions , proc )
86+ def AfterStep ( *tag_expressions , name : nil , &proc )
87+ Dsl . register_rb_hook ( 'after_step' , tag_expressions , proc , name : name )
8888 end
8989
9090 def ParameterType ( options )
@@ -108,20 +108,20 @@ def if_nil(value, default)
108108 end
109109
110110 # Registers a proc that will run after Cucumber is configured in order to install an external plugin.
111- def InstallPlugin ( &proc )
112- Dsl . register_rb_hook ( 'install_plugin' , [ ] , proc )
111+ def InstallPlugin ( name : nil , &proc )
112+ Dsl . register_rb_hook ( 'install_plugin' , [ ] , proc , name : name )
113113 end
114114
115115 # Registers a proc that will run before the execution of the scenarios.
116116 # Use it for your final set-ups
117- def BeforeAll ( &proc )
118- Dsl . register_rb_hook ( 'before_all' , [ ] , proc )
117+ def BeforeAll ( name : nil , &proc )
118+ Dsl . register_rb_hook ( 'before_all' , [ ] , proc , name : name )
119119 end
120120
121121 # Registers a proc that will run after the execution of the scenarios.
122122 # Use it for your final clean-ups
123- def AfterAll ( &proc )
124- Dsl . register_rb_hook ( 'after_all' , [ ] , proc )
123+ def AfterAll ( name : nil , &proc )
124+ Dsl . register_rb_hook ( 'after_all' , [ ] , proc , name : name )
125125 end
126126
127127 # Registers a new Ruby StepDefinition. This method is aliased
0 commit comments