From 72b557a3ee46a2b38a25288287a01b8308caabb8 Mon Sep 17 00:00:00 2001 From: Greg Lazarev Date: Fri, 28 Dec 2012 15:40:07 -0800 Subject: [PATCH] Use run_simple vs run to execute commands * run_simple tests that the command was successful --- features/step_definitions/suspenders_steps.rb | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/features/step_definitions/suspenders_steps.rb b/features/step_definitions/suspenders_steps.rb index 7cb28b728..67806a8c8 100644 --- a/features/step_definitions/suspenders_steps.rb +++ b/features/step_definitions/suspenders_steps.rb @@ -2,27 +2,22 @@ When 'I run rake' do in_current_dir do - run 'bundle exec rake' + run_simple 'bundle exec rake' end end When 'I run the rake task "$task_name"' do |task_name| in_current_dir do - run "bundle exec rake #{task_name}" - assert_exit_status(0) + run_simple "bundle exec rake #{task_name}" end end When 'I generate "$generator_with_args"' do |generator_with_args| in_current_dir do - run "bundle exec rails generate #{generator_with_args}" + run_simple "bundle exec rails generate #{generator_with_args}" end end -Then 'I see a successful response in the shell' do - assert_exit_status(0) -end - When 'I ensure no databases exist for "$project_name"' do |project_name| run "dropdb #{project_name}_development" run "dropdb #{project_name}_test" @@ -30,8 +25,7 @@ When 'I suspend a project called "$project_name"' do |project_name| suspenders_bin = File.expand_path(File.join('..', '..', 'bin', 'suspenders'), File.dirname(__FILE__)) - run "#{suspenders_bin} #{project_name}" - assert_exit_status(0) + run_simple "#{suspenders_bin} #{project_name}" end When /^I suspend a project called "([^"]*)" with:$/ do |project_name, arguments_table| @@ -39,8 +33,7 @@ arguments = arguments_table.hashes.inject([]) do |accum, argument| accum << "#{argument['argument']}=#{argument['value']}" end.join - run "#{suspenders_bin} #{project_name} #{arguments}" - assert_exit_status(0) + run_simple "#{suspenders_bin} #{project_name} #{arguments}" end When 'I cd to the "$test_project" root' do |dirname| @@ -53,7 +46,6 @@ And I run the rake task "db:migrate" And I run the rake task "db:test:prepare" And I run rake - Then I see a successful response in the shell } end