I’m having trouble testing my Rails 3 application. Unit testing
doesn’t work. If I try ruby article_test.rb directly, I get a “no
such file to load” error, and if I try rake test:units or ruby unit/
article_test.rb I get this odd “superclass mismatch for class
ArticlesController” error!
I’m hoping I can get this settled…
My test files were generated by the generator…
C:\Users\Family\workspace\jdrampage\test\unit>ruby article_test.rb
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require': no such file to load -- test_helper (LoadError) from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:31:in
require’
from article_test.rb:1
C:\Users\Family\workspace\jdrampage\test\unit>cd…
C:\Users\Family\workspace\jdrampage\test>ruby unit/article_test.rb
C:/Users/Family/workspace/jdrampage/app/controllers/
articles_controller.rb:1: superclass mismatch for class
ArticlesController (TypeError)
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/
active_support/dependencies.rb:239:in require' from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/ active_support/dependencies.rb:239:in
require’
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/
active_support/dependencies.rb:227:in load_dependency' from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/ active_support/dependencies.rb:239:in
require’
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/
active_support/dependencies.rb:346:in require_or_load' from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/ active_support/dependencies.rb:300:in
depend_on’
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/
active_support/dependencies.rb:216:in require_dependency' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/ rails/engine.rb:138:in
eager_load!’
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/
rails/engine.rb:137:in each' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/ rails/engine.rb:137:in
eager_load!’
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/
rails/engine.rb:135:in each' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/ rails/engine.rb:135:in
eager_load!’
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/
rails/application.rb:108:in eager_load!' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/ rails/application/finisher.rb:41 from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/ rails/initializable.rb:25:in
instance_exec’
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/
rails/initializable.rb:25:in run' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/ rails/initializable.rb:50:in
run_initializers’
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/
rails/initializable.rb:49:in each' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/ rails/initializable.rb:49:in
run_initializers’
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/
rails/application.rb:134:in initialize!' from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/ rails/application.rb:77:in
send’
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/
rails/application.rb:77:in method_missing' from C:/Users/Family/workspace/jdrampage/config/environment.rb: 5 from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:31:in
gem_original_require’
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:31:in require' from ./test_helper.rb:2 from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:31:in
gem_original_require’
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:31:in `require’
from unit/article_test.rb:1