I promised a friend of mine I’d help update his online store. To get
something up fast, I thought I’d try Substruct. But I can’t make
rspec specs run with it installed.
I’ve got the 1.2 RC 1 gem installed, and my environment.rb starts
“module Engines; EdgeRails = true; end”
I’ve succuessfully installed Engines and Substruct, got the database
set up, and managed to rub Webrick and log in to the admin section.
So the app seems fine.
I generated a controller with “script/generate rspec_controller
stock_list_import”, but I can’t run it. rspec dies with the error
below. This is the exact same error I had before I configured
everything correctly (if I remember right, before I set the EdgeRails
constant in Engines).
I don’t understand why SubstructApplicationController is not
available to the spec, because:
- the spec requires spec/spec_helper
- spec/spec_helper requires config/environment
- config/environment requires config/boot AND calls
surely this is near enough the same as booting Webrick?
Any ideas why it doesn’t work? And before anyone asks, I’m an rspec
whore. Using Test::Unit IS out of the question (not that I’ve
tried that anyway)
$ rake spec:controllers
lib" “/opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.4/bin/spec” “spec/
const_missing': uninitialized constant ApplicationController::SubstructApplicationController (NameError) from /Users/ashleymoran/Documents/Development/Stalmine/ stalmine_tech/config/../app/controllers/application.rb:5 from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/ custom_require.rb:27:ingem_original_require’
require' from /opt/local/lib/ruby/gems/1.8/gems/ activesupport-22.214.171.12418/lib/active_support/dependencies.rb:489:inrequire’
new_constants_in' from /opt/local/lib/ruby/gems/1.8/gems/ activesupport-126.96.36.19918/lib/active_support/dependencies.rb:489:inrequire’
gem_original_require' ... 20 levels... from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.4/lib/spec/ runner/command_line.rb:21:inrun’
each' from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.4/lib/spec/ runner/command_line.rb:15:inrun’
Command failed with status (1): [/opt/local/bin/ruby -I"/opt/local/