[rspec-users] Spec helper configuration problem

Andrew Premdas apremdas at gmail.com
Fri Nov 27 13:29:22 EST 2009

Hi all,

I have a rails application whose specs run on about eight different boxes,
but I can't get them to work on my integration server. The bit thats
breaking concerns some modules that I have in spec/support/modules which are
loaded by
the following line in spec_helper

    # get any macros etc
    Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}

one of these modules includes the other modules, and this generates the
following stacktrace

`load_missing_constant': uninitialized constant
OrderSpecHelper::BasketSpecHelper (NameError)
     from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in
     from ./spec/helpers/../support/modules/order_spec_helper.rb:2
     from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
     from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
     from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in

the line causing this is order_spec_helper.rb:2

  module OrderSpecHelper
    include BasketSpecHelper

and BasketSpecHelper is defined in

and is coded something like

  module BasketSpecHelper

I wonder if anyone has any ideas about the cause of this problem or some
ideas about possible solutions

Many thanks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20091127/6d55573b/attachment.html>

More information about the rspec-users mailing list