[rspec-users] preferred place for methods used by both rspec and cucumber?

Pat Maddox patmaddox at me.com
Fri Sep 23 12:42:59 EDT 2011


I use spec/support or Rails.root/bdd_support

not a big deal really. just pick a place and require em

On Sep 21, 2011, at 7:35 PM, Patrick J. Collins wrote:

> Hi,
> 
> I have some helper methods such as:
> 
> def mock_omniauth
>  OmniAuth.config.test_mode = true
>  OmniAuth.config.mock_auth[:facebook] = facebook_user
> end
> 
> def facebook_user
>  @facebook_user ||= HashWithIndifferentAccess.new(YAML.load(File.read("#{Rails.root}/test/fixtures/fb_user.yml")))
> end
> 
> that I want to use in both cucumber step definitions and rspec.  Is there a
> preferred place to store this code, or is it standard practice to just define
> them in a module in config/inititalizers and include that in both cucumber's
> env.rb and rspec's spec_helper.rb?
> 
> Thanks.
> 
> Patrick J. Collins
> http://collinatorstudios.com
> 
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list