Hi
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
Engines.start :substruct
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)
Ashley
$ rake spec:controllers
(in /Users/ashleymoran/Documents/Development/Stalmine/stalmine_tech)
/opt/local/bin/ruby -I"/opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.4/
lib" “/opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.4/bin/spec” “spec/
controllers/stock_list_import_controller_spec.rb”
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1.5618/lib/
active_support/dependencies.rb:471:in 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:in
gem_original_require’
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/
custom_require.rb:27:in require' from /opt/local/lib/ruby/gems/1.8/gems/ activesupport-1.3.1.5618/lib/active_support/dependencies.rb:489:in
require’
from /opt/local/lib/ruby/gems/1.8/gems/
activesupport-1.3.1.5618/lib/active_support/dependencies.rb:337:in
new_constants_in' from /opt/local/lib/ruby/gems/1.8/gems/ activesupport-1.3.1.5618/lib/active_support/dependencies.rb:489:in
require’
from /Users/ashleymoran/Documents/Development/Stalmine/
stalmine_tech/config/…/vendor/plugins/rspec/lib/rspec_on_rails.rb:1
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/
custom_require.rb:27:in 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:in
run’
from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.4/lib/spec/
runner/command_line.rb:15:in each' from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.4/lib/spec/ runner/command_line.rb:15:in
run’
from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.4/bin/spec:4
rake aborted!
Command failed with status (1): [/opt/local/bin/ruby -I"/opt/local/
lib/ruby…]