Skip to content

Commit

Permalink
minor refactoring of cucumber features
Browse files Browse the repository at this point in the history
* moved templates into cucumber/templates directory
* rake default will clean old sample app before creating new one
  • Loading branch information
alexrothenberg committed Jun 9, 2011
1 parent 83faaae commit 8aa6ee0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Rakefile
Expand Up @@ -17,6 +17,7 @@ end

Cucumber::Rake::Task.new(:cucumber)

# for cucumber features that create a sample project
def in_example_app(command)
Dir.chdir("./tmp/example_app/") do
Bundler.with_clean_env do
Expand All @@ -28,14 +29,20 @@ namespace :generate do
desc "generate a fresh app with rspec installed"
task :app do |t|
# unless File.directory?('./tmp/example_app')
sh "bundle exec rails new ./tmp/example_app -m 'templates/generate_example_app.rb'"
sh "cp 'templates/rspec.rake' ./tmp/example_app/lib/tasks"
sh "bundle exec rails new ./tmp/example_app -m 'features/templates/generate_example_app.rb'"
sh "cp 'features/templates/rspec.rake' ./tmp/example_app/lib/tasks"
in_example_app 'rake db:migrate'
in_example_app 'rails g rspec:install'
in_example_app 'bundle install'
# end
end
end

namespace :clobber do
desc "clobber the generated app"
task :app do
rm_rf "tmp/example_app"
end
end

task :default => [:spec, :'generate:app', :cucumber]
task :default => [:spec, :'clobber:app', :'generate:app', :cucumber]
File renamed without changes.
File renamed without changes.

0 comments on commit 8aa6ee0

Please sign in to comment.