The Ruby implementation of the programming language API.
# File lib/cucumber/rb_support/rb_language.rb, line 92 def begin_rb_scenario(scenario) create_world extend_world connect_world(scenario) end
# File lib/cucumber/rb_support/rb_language.rb, line 112 def build_rb_world_factory(world_modules, proc) if(proc) raise MultipleWorld.new(@world_proc, proc) if @world_proc @world_proc = proc end @world_modules ||= [] @world_modules += world_modules end
# File lib/cucumber/rb_support/rb_language.rb, line 62 def find_best_assertions_module begin ::RSpec::Matchers rescue NameError # RSpec >=1.2.4 begin options = OpenStruct.new(:diff_format => :unified, :context_lines => 3) Spec::Expectations.differ = Spec::Expectations::Differs::Default.new(options) ::Spec::Matchers rescue NameError ::Test::Unit::Assertions end end end
# File lib/cucumber/rb_support/rb_language.rb, line 121 def load_code_file(code_file) load File.expand_path(code_file) # This will cause self.add_step_definition, self.add_hook, and self.add_transform to be called from RbDsl end
# File lib/cucumber/rb_support/rb_language.rb, line 98 def register_rb_hook(phase, tag_expressions, proc) add_hook(phase, RbHook.new(self, tag_expressions, proc)) end
# File lib/cucumber/rb_support/rb_language.rb, line 106 def register_rb_step_definition(regexp, proc_or_sym, options) step_definition = RbStepDefinition.new(self, regexp, proc_or_sym, options) @step_definitions << step_definition step_definition end
# File lib/cucumber/rb_support/rb_language.rb, line 102 def register_rb_transform(regexp, proc) add_transform(RbTransform.new(self, regexp, proc)) end
# File lib/cucumber/rb_support/rb_language.rb, line 87 def snippet_text(code_keyword, step_name, multiline_arg_class, snippet_type = :regexp) snippet_class = typed_snippet_class(snippet_type) snippet_class.new(code_keyword, step_name, multiline_arg_class).to_s end
# File lib/cucumber/rb_support/rb_language.rb, line 77 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
Generated with the Darkfish Rdoc Generator 2.