Sha256: b557a4bd734ac972cc65b8035008e3ff61d2f8506b35b81a2169c89cba018f1f

Contents?: true

Size: 1.35 KB

Versions: 19

Compression:

Stored size: 1.35 KB

Contents

Given /^a directory without standard Cucumber project directory structure$/ do
  in_current_dir do
    FileUtils.rm_rf 'features' if File.directory?('features')
  end
end

Given /^a scenario with a step that looks like this:$/ do |string|
  create_feature do
    create_scenario { string }
  end
end

Given(/^a scenario with a step that looks like this in japanese:$/) do |string|
  create_feature_ja do
    create_scenario_ja { string }
  end
end

Given(/^the standard step definitions$/) do
  write_file 'features/step_definitions/steps.rb',

  <<-STEPS
  Given(/^this step passes$/)          { }
  Given(/^this step raises an error$/) { raise 'error' }
  Given(/^this step is pending$/)      { pending }
  Given(/^this step fails$/)           { fail }
  Given(/^this step is a table step$/) {|t| }
  STEPS
end

Given /^a step definition that looks like this:$/ do |string|
  create_step_definition { string }
end

When /^I run the feature with the (\w+) formatter$/ do |formatter|
  expect(features.length).to eq 1
  run_feature features.first, formatter
end

Then /^the stderr should contain a warning message$/ do
  expect(all_stderr).to include("[warning]")
end

module CucumberHelper
  def run_feature(filename = 'features/a_feature.feature', formatter = 'progress')
    run_simple "#{Cucumber::BINARY} #{filename} --format #{formatter}", false
  end
end

World(CucumberHelper)

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
cucumber-2.3.3 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.3.2 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.3.1 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.3.0 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.2.0 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.1.0 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.0.2 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.0.1 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.0.0 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.0.0.rc.5 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.0.0.rc.4 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.0.0.rc.3 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.0.0.rc.2 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.0.0.rc.1 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.0.0.beta.5 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.0.0.beta.4 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.0.0.beta.3 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.0.0.beta.2 features/lib/step_definitions/cucumber_steps.rb
cucumber-2.0.0.beta.1 features/lib/step_definitions/cucumber_steps.rb