Sha256: 3144d3cacd73bfd120cc5b666184a71ea9ab0fcb91d7ded82d7bb3b54c0c9bdc
Contents?: true
Size: 1.77 KB
Versions: 1
Compression:
Stored size: 1.77 KB
Contents
require 'cucumber/step_match' require 'cucumber/step_definition_light' module Cucumber module LanguageSupport module LanguageMethods def after_configuration(cli_configuration) configuration = Configuration.new(cli_configuration) hooks[:after_configuration].each do |hook| hook.invoke('AfterConfiguration', configuration) end end def execute_transforms(args) args.map do |arg| matching_transform = transforms.detect {|transform| transform.match(arg) } matching_transform ? matching_transform.invoke(arg) : arg end end def add_hook(phase, hook) hooks[phase.to_sym] << hook hook end def clear_hooks @hooks = nil end def add_transform(transform) transforms.unshift transform transform end def hooks_for(phase, scenario) #:nodoc: hooks[phase.to_sym].select{|hook| scenario.accept_hook?(hook)} end def unmatched_step_definitions available_step_definition_hash.keys - invoked_step_definition_hash.keys end def available_step_definition(regexp_source, location) available_step_definition_hash[StepDefinitionLight.new(regexp_source, location)] = nil end def invoked_step_definition(regexp_source, location) invoked_step_definition_hash[StepDefinitionLight.new(regexp_source, location)] = nil end private def available_step_definition_hash @available_step_definition_hash ||= {} end def invoked_step_definition_hash @invoked_step_definition_hash ||= {} end def hooks @hooks ||= Hash.new{|h,k| h[k] = []} end def transforms @transforms ||= [] end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cucumber-2.1.0 | lib/cucumber/language_support/language_methods.rb |