Sha256: 6ad705d743b88db3390100540af1a8eb17e561b033ca3a15fc6e9205b59eed92

Contents?: true

Size: 772 Bytes

Versions: 2

Compression:

Stored size: 772 Bytes

Contents

def prepare_cucumber_example
  @runtime = Cucumber::Runtime.new
  language = load_ruby_language
  scenario = double('scenario', :language => 'en', :accept_hook? => true)
  language.send(:begin_scenario, scenario)
  @world = language.current_world
  @main = Object.new
  @main.extend(Cucumber::RbSupport::RbDsl)
  # @runtime.before(scenario)
end

def load_ruby_language
  language = support_code.ruby if support_code.respond_to?(:ruby)
  language ||= support_code.load_programming_language('rb')
  language
end

def invoke_cucumber_step(step)
  support_code.step_match(step).invoke(nil) # nil means no multiline args
end

def support_code
  @runtime.instance_variable_get(:@support_code)
end

def first_step_match(*args)
  support_code.send(:step_matches, *args).first
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cucumber_priority-0.2.0 spec/support/cucumber_helper.rb
cucumber_priority-0.1.2 spec/cucumber_priority/cucumber_helper.rb