Parent

Class/Module Index [+]

Quicksearch

Cucumber::JsSupport::JsLanguage

Public Class Methods

new(step_mother) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 107
def initialize(step_mother)
  @step_definitions = []
  @world = JsWorld.new
  @step_mother = step_mother

  @world["jsLanguage"] = self
  @world.load(File.dirname(__FILE__) + '/js_dsl.js')
end

Public Instance Methods

add_step_definition(regexp, js_function) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 139
def add_step_definition(regexp, js_function)
  @step_definitions << JsStepDefinition.new(self, regexp, js_function)
end
alias_adverbs(adverbs) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 120
def alias_adverbs(adverbs)
end
begin_scenario(scenario) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 123
def begin_scenario(scenario)
end
current_world() click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 156
def current_world
  @world
end
end_scenario() click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 126
def end_scenario
end
execute_step_definition(name, multiline_argument = nil) click to toggle source

TODO: support multiline arguments when calling steps from within steps

# File lib/cucumber/js_support/js_language.rb, line 144
def execute_step_definition(name, multiline_argument = nil)
  @step_mother.step_match(name).invoke(multiline_argument)
end
load_code_file(js_file) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 116
def load_code_file(js_file)
  @world.load(js_file)
end
register_js_hook(phase, tag_expressions, js_function) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 148
def register_js_hook(phase, tag_expressions, js_function)
  add_hook(phase, JsHook.new(self, tag_expressions, js_function))
end
register_js_transform(regexp, js_function) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 152
def register_js_transform(regexp, js_function)
  add_transform(JsTransform.new(self, regexp, js_function))
end
step_matches(name_to_match, name_to_format) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 129
def step_matches(name_to_match, name_to_format)
  @step_definitions.map do |step_definition|
    if(arguments = step_definition.arguments_from(name_to_match))
      StepMatch.new(step_definition, name_to_match, name_to_format, arguments)
    else
      nil
    end
  end.compact
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.