Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Commit

Permalink
Made some tweaks needed for cucumber-jvm, which is maven/junit based
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Jun 27, 2011
1 parent c1c6975 commit 5dcb569
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
14 changes: 4 additions & 10 deletions step_definitions/cucumber_mappings.rb
@@ -1,22 +1,16 @@
require 'aruba/cucumber'

module CucumberMappings
def scenario_with_steps(scenario_name, steps)
write_file("features/a_feature.feature", <<-EOF)
write_file("#{features_dir}/a_feature.feature", <<-EOF)
Feature: A feature
Scenario: #{scenario_name}
#{steps.gsub(/^/, ' ')}
EOF
end

def write_feature(feature)
write_file("features/a_feature.feature", feature)
end

def run_scenario(scenario_name)
run_simple "#{cucumber_bin} features/a_feature.feature --name '#{scenario_name}'", false
end

def run_feature
run_simple "#{cucumber_bin} features/a_feature.feature", false
write_file("#{features_dir}/a_feature.feature", feature)
end

def assert_skipped(pattern)
Expand Down
14 changes: 5 additions & 9 deletions step_definitions/cucumber_stepdefs.rb
Expand Up @@ -38,30 +38,26 @@
end

Then /^the scenario passes$/ do
assert_partial_output("1 scenario (1 passed)", all_output)
assert_success true
assert_passing_scenario
end

Then /^the scenario fails$/ do
assert_partial_output("1 scenario (1 failed)", all_output)
assert_success false
assert_failing_scenario
end

Then /^the scenario is pending$/ do
assert_partial_output("1 scenario (1 pending)", all_output)
assert_success true
assert_pending_scenario
end

Then /^the scenario is undefined$/ do
assert_partial_output("1 scenario (1 undefined)", all_output)
assert_success true
assert_undefined_scenario
end

Then /^the step "([^"]*)" is skipped$/ do |pattern|
assert_skipped(pattern)
end

Then /^the feature passes$/ do
assert_no_partial_output("failed", all_output)
assert_no_partial_output(failed_output, all_output)
assert_success true
end

0 comments on commit 5dcb569

Please sign in to comment.