class Cucumber::Glue::Hook
TODO: Kill pointless wrapper for Before, After and AfterStep hooks with fire
Attributes
location[R]
tag_expressions[R]
Public Class Methods
new(registry, tag_expressions, proc)
click to toggle source
# File lib/cucumber/glue/hook.rb, line 11 def initialize(registry, tag_expressions, proc) @registry = registry @tag_expressions = tag_expressions @proc = proc @location = Cucumber::Core::Ast::Location.from_source_location(*@proc.source_location) warn_for_old_style_tag_expressions(tag_expressions) end
Public Instance Methods
invoke(pseudo_method, arguments, &block)
click to toggle source
# File lib/cucumber/glue/hook.rb, line 19 def invoke(pseudo_method, arguments, &block) check_arity = false InvokeInWorld.cucumber_instance_exec_in( @registry.current_world, check_arity, pseudo_method, *[arguments, block].flatten.compact, &@proc ) end
Private Instance Methods
warn_for_old_style_tag_expressions(tag_expressions)
click to toggle source
# File lib/cucumber/glue/hook.rb, line 32 def warn_for_old_style_tag_expressions(tag_expressions) tag_expressions.each do |tag_expression| if tag_expression.include?('~') && tag_expression != '~@no-clobber' # ~@no-clobber is used in aruba warn("Deprecated: Found tagged hook with '#{tag_expression}'. Support for '~@tag' will be removed from the next release of Cucumber. Please use 'not @tag' instead.") end if tag_expression.include?(',') warn("Deprecated: Found tagged hook with '#{tag_expression}'. Support for '@tag1,@tag2' will be removed from the next release of Cucumber. Please use '@tag or @tag2' instead.") end end end