module Cucumber::RbSupport::RbDsl
def After(*tag_expressions, &proc)
Registers a proc that will run after each Scenario. You can register as many
def After(*tag_expressions, &proc) RbDsl.register_rb_hook('after', tag_expressions, proc) end
def AfterConfiguration(&proc)
Registers a proc that will run after Cucumber is configured. You can register as
def AfterConfiguration(&proc) RbDsl.register_rb_hook('after_configuration', [], proc) end
def AfterStep(*tag_expressions, &proc)
Registers a proc that will run after each Step. You can register as
def AfterStep(*tag_expressions, &proc) RbDsl.register_rb_hook('after_step', tag_expressions, proc) end
def Around(*tag_expressions, &proc)
blocks in 1.8), on which it should call the .call method. You can register
argument (but passed as a regular argument, since blocks cannot accept
should accept two arguments: two arguments: the scenario and a "block"
Registers a proc that will be wrapped around each scenario. The proc
def Around(*tag_expressions, &proc) RbDsl.register_rb_hook('around', tag_expressions, proc) end
def Before(*tag_expressions, &proc)
Registers a proc that will run before each Scenario. You can register as many
def Before(*tag_expressions, &proc) RbDsl.register_rb_hook('before', tag_expressions, proc) end
def Transform(regexp, &proc)
provided proc. The return value of the proc is consequently yielded to the
the pattern contains captures then they will be yielded as arguments to the
matches the pattern passed as the first argument to Transform. Alternatively, if
Registers a proc that will be called with a step definition argument if it
def Transform(regexp, &proc) RbDsl.register_rb_transform(regexp, proc) end
def World(*world_modules, &proc)
World(MyModule)
end
MyClass.new
World do
Cucumber will not yield anything to the +proc+. Examples:
one Proc you will get an error.
like (to register more modules), but if you try to register more than
features/support. You can call this method as many times as you
This method is typically called from one or more Ruby scripts under
will be mixed into this Object (via Object#extend).
Object that the scenario's steps will run within. Any +world_modules+
The +proc+ will be executed once before each scenario to create an
Registers any number of +world_modules+ (Ruby Modules) and/or a Proc.
def World(*world_modules, &proc) RbDsl.build_rb_world_factory(world_modules, proc) end
def alias_adverb(adverb)
def alias_adverb(adverb) alias_method adverb, :register_rb_step_definition end
def build_rb_world_factory(world_modules, proc)
def build_rb_world_factory(world_modules, proc) @rb_language.build_rb_world_factory(world_modules, proc) end
def register_rb_hook(phase, tag_names, proc)
def register_rb_hook(phase, tag_names, proc) @rb_language.register_rb_hook(phase, tag_names, proc) end
def register_rb_step_definition(regexp, proc)
def register_rb_step_definition(regexp, proc) @rb_language.register_rb_step_definition(regexp, proc) end
def register_rb_step_definition(regexp, &proc)
object is created for each scenario and is shared across
object, which is defined by #World. A new World
The +&proc+ gets executed in the context of a World
new language is loaded.
also to the i18n translations whenever a feature of a
to Given, When and Then, and
Registers a new Ruby StepDefinition. This method is aliased
def register_rb_step_definition(regexp, &proc) RbDsl.register_rb_step_definition(regexp, proc) end
def register_rb_transform(regexp, proc)
def register_rb_transform(regexp, proc) @rb_language.register_rb_transform(regexp, proc) end