Skip to content

Grouping Tests by Directory

bret edited this page Sep 13, 2010 · 1 revision

Cucumber Tests

Today, WatirCraft supports storing features in nested directories. You
can use the cucumber command to run only the features in a particular subdirectory.

Rspec Tests

If you want to store specs from nested directories, you
need to copy the spec_helper.rb into each subdirectory and modify this
line so that it continues to correctly point to the lib directory (where
you store all your helpers):

$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../../lib/')

(It would would be nice if the spec generator knew how to
do this automatically, but it does not currently do this.)

After you have done this, you can use the spec command to run tests from a specific directory (or just use ruby).

Using Rake

In both cases, you would currently need to use the cucumber/rspec
commands to run tests from only one directory. But we could add rake
tasks to WatirCraft that would do this automatically. I don’t think this
would be very difficult. Let me know.

Clone this wiki locally