Permalink
Browse files

Made some tweaks needed for cucumber-jvm, which is maven/junit based

  • Loading branch information...
aslakhellesoy committed Jun 27, 2011
1 parent c1c6975 commit 5dcb569f6e2d8d4a6803893298d769a100a06b19
Showing with 9 additions and 19 deletions.
  1. +4 −10 step_definitions/cucumber_mappings.rb
  2. +5 −9 step_definitions/cucumber_stepdefs.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)
@@ -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.