Parent

Included Modules

Class Index [+]

Quicksearch

Cucumber::JsSupport::JsLanguage

Public Class Methods

new(step_mother) click to toggle source
     # 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

Public Instance Methods

add_step_definition(regexp, js_function) click to toggle source
     # 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
alias_adverbs(adverbs) click to toggle source
     # File lib/cucumber/js_support/js_language.rb, line 123
123:       def alias_adverbs(adverbs)
124:       end
begin_scenario(scenario) click to toggle source
     # File lib/cucumber/js_support/js_language.rb, line 126
126:       def begin_scenario(scenario)
127:         @language = scenario.language
128:       end
current_world() click to toggle source
     # File lib/cucumber/js_support/js_language.rb, line 160
160:       def current_world
161:         @world
162:       end
end_scenario() click to toggle source
     # File lib/cucumber/js_support/js_language.rb, line 130
130:       def end_scenario
131:       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 148
148:       def execute_step_definition(name, multiline_argument = nil)
149:         @step_mother.step_match(name).invoke(multiline_argument)
150:       end
load_code_file(js_file) click to toggle source
     # File lib/cucumber/js_support/js_language.rb, line 113
113:       def load_code_file(js_file)
114:         @world.load(js_file)
115:       end
register_js_hook(phase, tag_expressions, js_function) click to toggle source
     # 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
register_js_transform(regexp, js_function) click to toggle source
     # 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
step_matches(name_to_match, name_to_format) click to toggle source
     # 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
steps(steps_text, file_colon_line) click to toggle source
     # File lib/cucumber/js_support/js_language.rb, line 164
164:       def steps(steps_text, file_colon_line)
165:         @step_mother.invoke_steps(steps_text, @language, file_colon_line)
166:       end
world(js_files) click to toggle source
     # File lib/cucumber/js_support/js_language.rb, line 117
117:       def world(js_files)
118:         js_files.each do |js_file|
119:           load_code_file("#{path_to_load_js_from}#{js_file}")
120:         end
121:       end

Private Instance Methods

path_to_load_js_from() click to toggle source
     # 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.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.