# File lib/cucumber/js_support/js_language.rb, line 104
104: def initialize(step_mother)
105: @step_definitions = []
106: @world = JsWorld.new
107: @step_mother = step_mother
108:
109: @world["jsLanguage"] = self
110: @world.load(File.dirname(__FILE__) + '/js_dsl.js')
111: end
# File lib/cucumber/js_support/js_language.rb, line 143
143: def add_step_definition(regexp, js_function)
144: @step_definitions << JsStepDefinition.new(self, regexp, js_function)
145: end
# File lib/cucumber/js_support/js_language.rb, line 123
123: def alias_adverbs(adverbs)
124: end
# File lib/cucumber/js_support/js_language.rb, line 126
126: def begin_scenario(scenario)
127: @language = scenario.language
128: end
# File lib/cucumber/js_support/js_language.rb, line 160
160: def current_world
161: @world
162: end
# File lib/cucumber/js_support/js_language.rb, line 130
130: def end_scenario
131: end
TODO: support multiline arguments when calling steps from within steps
# File lib/cucumber/js_support/js_language.rb, line 148
148: def execute_step_definition(name, multiline_argument = nil)
149: @step_mother.step_match(name).invoke(multiline_argument)
150: end
# File lib/cucumber/js_support/js_language.rb, line 113
113: def load_code_file(js_file)
114: @world.load(js_file)
115: end
# File lib/cucumber/js_support/js_language.rb, line 152
152: def register_js_hook(phase, tag_expressions, js_function)
153: add_hook(phase, JsHook.new(self, tag_expressions, js_function))
154: end
# File lib/cucumber/js_support/js_language.rb, line 156
156: def register_js_transform(regexp, js_function)
157: add_transform(JsTransform.new(self, regexp, js_function))
158: end
# File lib/cucumber/js_support/js_language.rb, line 133
133: def step_matches(name_to_match, name_to_format)
134: @step_definitions.map do |step_definition|
135: if(arguments = step_definition.arguments_from(name_to_match))
136: StepMatch.new(step_definition, name_to_match, name_to_format, arguments)
137: else
138: nil
139: end
140: end.compact
141: end
# File lib/cucumber/js_support/js_language.rb, line 169
169: def path_to_load_js_from
170: paths = @step_mother.options[:paths]
171: if paths.empty?
172: '' # Using rake
173: else
174: path = paths[0][/(^.*\/?features)/, 0]
175: path ? "#{path}/../" : '../'
176: end
177: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.