Wednesday, June 16, 2010

rails - Executing a single testcase

To direct run a single rails test case;
1) Run the full test system from rake stop it and remove the lead items up to the rake_test_loader.rb part of the command line.
2) Then add on the test case file from the rails app root dir.
3) The with your editor pull the test_... method name of the test and add a "-n..." (without a space) to the end of the line.

The resultant command line looks something like this.

/usr/bin/ruby1.8 -I"lib:test" "<gems_dir>/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/functional/<test_case_file>.rb" -n<test_def_name>

No comments:

Post a Comment