Ruby / Rails Testing information
Some testing related information (for ruby/rails):
gems to install:
sudo gem install term-ansicolor treetop diff-lcs nokogiri builder
sudo gem install ZenTest redgreen autotest-rails rspec rspec-rails cucumber webrat
sudo gem install ZenTest redgreen autotest-rails rspec rspec-rails cucumber webrat
cucumber.yml: (in config in rails project)
autotest-all: --require features --require lib --format progress features
autotest: --require features --require lib features
default: --format pretty --color
html: --format html --out features.html
autotest: --require features --require lib features
default: --format pretty --color
html: --format html --out features.html
.profile: (add)
export AUTOFEATURE=true
Create your rails project:
rails project_name
ruby script/generate rspec
ruby script/generate cucumber
rake db:migrate
rake cucumber
ruby script/generate rspec
ruby script/generate cucumber
rake db:migrate
rake cucumber
Then you should be all setup to run autotest in your rails project.
My starting template for rails:
# remove default files
run "rm public/index.html"
# additional plugins
plugin 'will_paginate', :git => 'git://github.com/mislav/will_paginate.git'
plugin 'exception_notifier', :git => 'git://github.com/rails/exception_notification.git'
plugin 'asset_packager', :git => 'http://synthesis.sbecker.net/pages/asset_packager'
gem 'test-unit', :lib => 'test/unit'
gem 'rspec', :lib => 'spec'
gem 'rspec-rails', :lib => 'spec/rails'
rake("gems:install", :sudo => true)
generate(:rspec)
generate(:cucumber)
run "rm public/index.html"
# additional plugins
plugin 'will_paginate', :git => 'git://github.com/mislav/will_paginate.git'
plugin 'exception_notifier', :git => 'git://github.com/rails/exception_notification.git'
plugin 'asset_packager', :git => 'http://synthesis.sbecker.net/pages/asset_packager'
gem 'test-unit', :lib => 'test/unit'
gem 'rspec', :lib => 'spec'
gem 'rspec-rails', :lib => 'spec/rails'
rake("gems:install", :sudo => true)
generate(:rspec)
generate(:cucumber)
Authentication template for rails:
plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git'
gem 'rubyist-aasm', :lib => 'aasm', :source => 'http://gems.github.com'
gem 'ruby-openid', :lib => 'openid', :version => '2.1.7'
generate(:authenticated, "user session",
"--aasm",
"--rspec",
"--old-passwords"
)
gem 'rubyist-aasm', :lib => 'aasm', :source => 'http://gems.github.com'
gem 'ruby-openid', :lib => 'openid', :version => '2.1.7'
generate(:authenticated, "user session",
"--aasm",
"--rspec",
"--old-passwords"
)
My features template for rails:
# additional plugins
plugin 'acts_as_taggable_on', :git => 'git://github.com/mbleigh/acts-as-taggable-on.git'
plugin 'acts_as_rateable', :git => 'git://github.com/azabaj/acts_as_rateable.git'
plugin 'acts_as_commentable', :git => 'git://github.com/jackdempsey/acts_as_commentable.git'
plugin 'acts_as_votable', :git => 'git://github.com/jaggederest/acts_as_voteable.git'
plugin 'acts_as_taggable_on', :git => 'git://github.com/mbleigh/acts-as-taggable-on.git'
plugin 'acts_as_rateable', :git => 'git://github.com/azabaj/acts_as_rateable.git'
plugin 'acts_as_commentable', :git => 'git://github.com/jackdempsey/acts_as_commentable.git'
plugin 'acts_as_votable', :git => 'git://github.com/jaggederest/acts_as_voteable.git'
Cucumber Wiki - http://wiki.github.com/aslakhellesoy/cucumber
Have other information that you find useful? Let me know.

Comments
Post new comment