Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danieljohnmorris/406257 to your computer and use it in GitHub Desktop.
Save danieljohnmorris/406257 to your computer and use it in GitHub Desktop.
r3 app tpl - setup cucumber and rspec for rails
# usage (in app dir):
# rake rails:template LOCATION=http://gist.github.com/406257.txt
gem "database_cleaner"
group :test do
gem "launchy" # So you can do Then show me the page
# gem "capybara" # alternative to webrat
gem "spork"
gem "cucumber-rails"
gem "cucumber", "0.7.2"
gem "rspec"
gem "rspec-rails", "2.0.0.beta.8"
gem "webrat"
gem "selenium-client"
end
generate "cucumber:skeleton --rspec --webrat"
generate "rspec:install"
run "spork --bootstrap"
git :add => "Gemfile"
git :add => "spec/spec_helper.rb"
git :commit => "-m 'Bootstrap testing w/ cucumber/rspec etc'"
if yes?("Do you want to append to README?")
# run "# add redis & resque sections to README"
# add useful instructions redis & resque worker commands to app's README
File.open('README', 'a') do |f| f.write <<-TXT
== Cucumber
=== Install/First-run:
rails g cucumber:skeleton --rspec --webrat
=== Run tests:
rake cucumber
== RSpec
=== Install/First-run:
rails g rspec:install
=== Run tests:
rake rspec
TXT
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment