[rspec-users] helpers for examples?
zach.dennis at gmail.com
Fri May 15 12:29:19 EDT 2009
On Fri, May 15, 2009 at 9:04 AM, Denis Haskin <denis at haskinferguson.net> wrote:
> Where's the recommended place to put helper methods & etc for examples?
> I've started putting them in spec/spec_helper.rb but that's going to get
> awfully cluttered. I'm thinking maybe a spec/lib, and add that to include
> path? Or just put them in lib? I notice restful_authentication (I think)
> put AuthenticatedTestHelper there.
I make a spec/spec_helpers/ directory and put them in there. I try to
namespace them in the module SpecHelpers to avoid conflict and/or
confusion with other modules in the app.
I would not use spec/lib/, because a rails app has a lib directory,
and convention would have someone assume spec/lib/ are specs for
objects in RAILS_ROOT/lib/.
> rspec-users mailing list
> rspec-users at rubyforge.org
http://www.mutuallyhuman.com (hire me)
More information about the rspec-users