Permalink
Browse files

Use run_simple vs run to execute commands

* run_simple tests that the command was successful
  • Loading branch information...
1 parent 2bb5d08 commit 72b557a3ee46a2b38a25288287a01b8308caabb8 @gylaz gylaz committed Dec 28, 2012
Showing with 5 additions and 13 deletions.
  1. +5 −13 features/step_definitions/suspenders_steps.rb
@@ -2,45 +2,38 @@
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"
end
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|
suspenders_bin = File.expand_path(File.join('..', '..', 'bin', 'suspenders'), File.dirname(__FILE__))
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

0 comments on commit 72b557a

Please sign in to comment.