Reply to comment

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

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

.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

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)

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"
        )

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'

Cucumber Wiki - http://wiki.github.com/aslakhellesoy/cucumber

Have other information that you find useful? Let me know.

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <as>, <bash>, <c>, <cpp>, <csharp>, <drupal5>, <drupal6>, <haskell>, <java>, <javascript>, <lisp>, <mysql>, <objc>, <perl>, <php>, <python>, <rails>, <ruby>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
4 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.