public
Rubygem
Fork of thoughtbot/shoulda
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/technicalpickles/shoulda.git
Joe Ferris (author)
Thu Sep 04 13:06:15 -0700 2008
commit  823cad39b0f1b44248f281883250f596433b2047
tree    050835bab21ff73893f8b9e6174c37125997c966
parent  ba96dddaa854d0440605b6f7ce82a238d61b2ceb
shoulda / test
name age message
..
file README Fri Jul 11 18:03:50 -0700 2008 Rid the symlink behavior under test/rails_root/... [rmm5t]
directory fixtures/ Sun Aug 31 09:14:16 -0700 2008 Fixed should_have_many regression [#60] [rmm5t]
directory functional/ Tue Sep 02 13:49:13 -0700 2008 Deprecated load_all_fixtures [#65] [rmm5t]
directory other/ Thu Sep 04 13:07:43 -0700 2008 Fixed a typo that resulted in a test that would... [Joe Ferris]
directory rails_root/ Sun Aug 31 09:46:38 -0700 2008 Testing fix for incorrectly specified :source o... [rmm5t]
file test_helper.rb Fri Jul 11 18:03:50 -0700 2008 Rid the symlink behavior under test/rails_root/... [rmm5t]
directory unit/ Tue Sep 02 13:49:13 -0700 2008 Deprecated load_all_fixtures [#65] [rmm5t]
README
The Shoulda test suite (in particular - the tests that test shoulda)

Quick overview:

The test directory contains the following files and subdirectories:

* rails_root - contains the stripped down rails application that the tests run against.  The rails root contains:
** the models, controllers, and views defined under app/
** the sqlite3.rb environment file
** a migration file for each model
** a shoulda initializer that simulates loading the plugin but without relying on vendor/plugins
* fixtures - contain the sample DB data for each model
* functional - controller tests for each of the controllers under rails_root/app
* unit - model tests for each of the models under rails_root/app
* other - tests for the shoulda contexts, should statements, and assertions
* test_helper.rb - responsible for initializing the test environment
** sets the rails_env to sqlite3
** sets the rails_root
** runs all the migrations against the in-memory sqlite3 db
** adds some magic to load the right fixture files

In order to add a new model (or controller) to the test suite:

* add that model to rails_root/app/models
* add a migration for that model
* add a fixture file
* add a test for that file under test/units

Dependencies:

* Rails gem installed in the host system
* A working sqlite3 installation.

If you have problems running these tests, please notify the mailing list:  shoulda@googlegroups.com

- Tammer Saleh <tsaleh@thoughtbot.com>