Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Harold Giménez
committed
Oct 28, 2011
1 parent
bcfb05e
commit 518f4d8
Showing
2 changed files
with
34 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,44 @@ | ||
require 'aruba/cucumber' | ||
|
||
Before do | ||
@aruba_timeout_seconds = 60 | ||
end | ||
|
||
After do | ||
FileUtils.rm_rf('test_project') | ||
end | ||
|
||
When 'I run the rake task "$task_name"' do |task_name| | ||
Dir.chdir('test_project') do | ||
system("rake #{task_name}") | ||
in_current_dir do | ||
run "bundle exec rake #{task_name}" | ||
end | ||
end | ||
|
||
When 'I generate "$generator_with_args"' do |generator_with_args| | ||
Dir.chdir('test_project') do | ||
system("rails generate #{generator_with_args}") | ||
in_current_dir do | ||
run "bundle exec rails generate #{generator_with_args}" | ||
end | ||
end | ||
|
||
Then 'I see a successful response in the shell' do | ||
$?.to_i.should == 0 | ||
assert_exit_status(0) | ||
end | ||
|
||
When 'I drop and create the required databases' do | ||
Dir.chdir('test_project') do | ||
system("rake db:drop RAILS_ENV=test") | ||
system("rake db:drop") | ||
system("rake db:create RAILS_ENV=test") | ||
system("rake db:create") | ||
in_current_dir do | ||
run 'bundle exec rake db:drop RAILS_ENV=test' | ||
run 'bundle exec rake db:drop' | ||
run 'bundle exec rake db:create RAILS_ENV=test' | ||
run 'bundle exec rake db:create' | ||
end | ||
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) | ||
end | ||
|
||
When 'I cd to the "$test_project" root' do |dirname| | ||
cd dirname | ||
end |