Spec/support directory outside Rails?

Hi,

I have a group of non-Rails R. projects that all make heavy use of
RSpec. Each of these projects has a “spec” directory with a
“helper.rb” file. All the *_spec.rb files in the spec directory tree
do the usual

require File.dirname(FILE) + “/…/helper”

like dance. I understand that RSpec for Rails will look for a “spec/
support” directory and require any files found there? Is there a
similar scheme for non-Rails projects?

Any advice on this much appreciated!

Stu

On May 14, 2010, at 7:03 PM, Stu wrote:

support" directory and require any files found there? Is there a
similar scheme for non-Rails projects?

That doesn’t happen automatically in RSpec. The spec/spec_helper.rb file
that gets generated when you configure a rails app with rspec includes
this line:

Dir["#{File.dirname(FILE)}/support/**/*.rb"].each {|f| require f}

Just include a similar line in your helper file and you’re good to go.