Test problem

Hi everyone,

I ran into some problems during testing. The problem was like:

root> ruby test/unit/game_test.rb
/usr/lib/ruby/1.8/test/unit/assertionfailederror.rb:7: Test is not a
module (TypeError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
from /home/gaoxh04/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:158:in require' from /usr/lib/ruby/1.8/test/unit/assertions.rb:5 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from /home/gaoxh04/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/ active_support/dependencies.rb:158:inrequire’
from /usr/lib/ruby/1.8/test/unit/testcase.rb:7
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
from /home/gaoxh04/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:158:in require' from /usr/lib/ruby/1.8/test/unit.rb:1 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from /home/gaoxh04/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/ active_support/dependencies.rb:158:inrequire’
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/test_help.rb:5
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
from /home/gaoxh04/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:158:in require' from ./test/unit/../test_helper.rb:3 from test/unit/game_test.rb:1:inrequire’
from test/unit/game_test.rb:1

My game_test.rb is really simple:

require File.dirname(FILE)+’/…/test_helper’
class GameTest < ActiveSupport::TestCase
def test_game
end
end

what is the problem? I have spent a lot of time on it but no luck.

thanks in advance

xiahong

Xiahong,

The message “Test is not a module” is the error you want to address.

I’d check that your test helper doesn’t have “include Test” or maybe
Test.module_eval someplace in it.

:S

sorry, i didn’t get it… how can i fix this problem?

2009/7/13 Gavin [email protected]

I have fixed this problem. This is related to the issue that I tried to
name
some classes with reserved name “test”. Thanks all!!

2009/7/13 gaoxh gaoxh04 [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs