Created
June 9, 2010 03:03
-
-
Save kristianmandrup/430984 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Rails 3 with RSpec 2 and Cucumber | |
********************************* | |
http://blog.adsdevshop.com/2010/06/06/tdd-on-the-bleeding-edge-with-ruby193-rails3-rspec-cucumber-autotest-and-factory-girl/ | |
gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n | |
gem install rails --pre | |
rails tddisbest | |
cd tddisbest | |
rails server | |
browser: http://localhost:3000 | |
gem install rspec-rails --pre | |
# Gemfile | |
source 'http://rubygems.org' | |
gem 'rails', '3.0.0.beta3' | |
gem 'sqlite3-ruby', :require => 'sqlite3' | |
# test environment: | |
group :test do | |
gem "rspec-rails", ">= 2.0.0.beta.10", :git => "git://github.com/rspec/rspec-rails.git" | |
gem "rspec", ">= 2.0.0.beta.10", :git => "git://github.com/rspec/rspec.git" | |
gem "rspec-core", ">= 2.0.0.beta.10", :git => "git://github.com/rspec/rspec-core.git" | |
gem "rspec-expectations", ">= 2.0.0.beta.10", :git => "git://github.com/rspec/rspec-expectations.git" | |
gem "rspec-mocks", ">= 2.0.0.beta.10", :git => "git://github.com/rspec/rspec-mocks.git" | |
end | |
--- | |
bundle install | |
rails g rspec:install | |
rails g scaffold Product name:string description:text price:decimal | |
rake db:migrate | |
rake spec | |
# Gemfile | |
group :test do | |
... | |
gem 'capybara' | |
gem 'database_cleaner' | |
gem 'cucumber-rails' | |
gem 'cucumber', '0.7.3' | |
gem 'spork' | |
gem 'launchy' | |
end | |
--- | |
bundle install | |
rails g cucumber:skeleton --rspec --capybara | |
rake cucumber | |
gem install autotest autotest-fsevent autotest-growl autotest-rails | |
gem list autotest | |
-- | |
autotest (4.2.10) | |
autotest-fsevent (0.2.2) | |
autotest-growl (0.2.4) | |
autotest-rails (4.1.0) | |
-- | |
autotest | |
Factory girl: | |
--- | |
# Gemfile | |
group :test do | |
... | |
gem 'factory_girl', :git => 'git://github.com/thoughtbot/factory_girl.git', :branch => 'rails3' | |
end | |
spec_helper.rb | |
require 'factory_girl' | |
Configure use of Database cleaner | |
--- | |
env.rb | |
require 'database_cleaner' | |
DatabaseCleaner.strategy = :truncation | |
DatabaseCleaner.clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment