Constantin Gavrilescu
2009-Apr-06 22:09 UTC
After Rails 2.3.2 upgrade: superclass mismatch for class TestCase (TypeError)
I upgraded a working app from rails 2.1 to 2.3.2. Now when I run rake test:units I get this error: /usr/lib/ruby/gems/1.8/gems/ activesupport-2.3.2/lib/active_support/test_case.rb:17: superclass mismatch for class TestCase (TypeError) I generated a new test app and all tests run OK. For the upgrade I ran rake:update and renamed the class in test_helper to ActiveSupport::TestCase. Also renamed the classes in all unit tests and to inherit from ActiveSupport::TestCase and in functional tests to inherit from ActionController::TestCase. I still could not fix it this error. I compared line by line the config files and the test_helper.rb with a brand new app and there are almost the same. Google didn''t provide any clue. Full stack trace here: /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/ test_case.rb:17: superclass mismatch for class TestCase (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:in `require'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ active_support/dependencies.rb:158:in `require'' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ action_controller/test_case.rb:1 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:in `require'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ active_support/dependencies.rb:158:in `require'' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/test_help.rb:6 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:in `require'' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ active_support/dependencies.rb:158:in `require'' from /home/costi/workspace/r2rrails/test/test_helper.rb:3 from ./test/unit/customer_test.rb:1:in `require'' from ./test/unit/customer_test.rb:1 from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ rake_test_loader.rb:5:in `load'' from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ rake_test_loader.rb:5 from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ rake_test_loader.rb:5:in `each'' from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ rake_test_loader.rb:5 rake aborted! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2009-Apr-06 22:23 UTC
Re: After Rails 2.3.2 upgrade: superclass mismatch for class TestCase (TypeError)
On Apr 6, 11:09 pm, Constantin Gavrilescu <comisarulmoldo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I upgraded a working app from rails 2.1 to 2.3.2. Now when I run rake > test:units I get this error: /usr/lib/ruby/gems/1.8/gems/ > activesupport-2.3.2/lib/active_support/test_case.rb:17: superclass > mismatch for class TestCase (TypeError) > > I generated a new test app and all tests run OK. > > For the upgrade I ran rake:update and renamed the class in test_helper > to ActiveSupport::TestCase. Also renamed the classes in all unit tests > and to inherit from ActiveSupport::TestCase and in functional tests to > inherit from ActionController::TestCase.Looks to me like you accidentally declared a new class called ActiveSupport::TestCase. You said your test_helper.rb is almost the same as one in a freshly generated app - what are the differences? Fred> I still could not fix it this error. I compared line by line the > config files and the test_helper.rb with a brand new app and there are > almost the same. Google didn''t provide any clue. > > Full stack trace here: > > /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > test_case.rb:17: superclass mismatch for class TestCase (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:in > `require'' > from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ > active_support/dependencies.rb:158:in `require'' > from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ > action_controller/test_case.rb:1 > 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:in > `require'' > from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ > active_support/dependencies.rb:158:in `require'' > from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/test_help.rb:6 > 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:in > `require'' > from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ > active_support/dependencies.rb:158:in `require'' > from /home/costi/workspace/r2rrails/test/test_helper.rb:3 > from ./test/unit/customer_test.rb:1:in `require'' > from ./test/unit/customer_test.rb:1 > from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ > rake_test_loader.rb:5:in `load'' > from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ > rake_test_loader.rb:5 > from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ > rake_test_loader.rb:5:in `each'' > from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ > rake_test_loader.rb:5 > rake aborted!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Constantin Gavrilescu
2009-Apr-06 22:41 UTC
Re: After Rails 2.3.2 upgrade: superclass mismatch for class TestCase (TypeError)
On 6 avr, 17:23, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Apr 6, 11:09 pm, Constantin Gavrilescu > > <comisarulmoldo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I upgraded a working app from rails 2.1 to 2.3.2. Now when I run rake > > test:units I get this error: /usr/lib/ruby/gems/1.8/gems/ > > activesupport-2.3.2/lib/active_support/test_case.rb:17: superclass > > mismatch for class TestCase (TypeError) > > > I generated a new test app and all tests run OK. > > > For the upgrade I ran rake:update and renamed the class in test_helper > > to ActiveSupport::TestCase. Also renamed the classes in all unit tests > > and to inherit from ActiveSupport::TestCase and in functional tests to > > inherit from ActionController::TestCase. > > Looks to me like you accidentally declared a new class called > ActiveSupport::TestCase. You said your test_helper.rb is almost the > same as one in a freshly generated app - what are the differences?This is the diff between the two test_helper.rb (one being the virgin one, the second being the new one). Not much of a difference but my extra functions. 18,21d17 < # < # The only drawback to using transactional fixtures is when you actually < # need to test transactions. Since your test is bracketed by a transaction, < # any transactions started in your code will be automatically rolled back. 23a20>36a34,35> # >37a37,56> > def login_as(user) > @request.session[:uid] = user.id > end > > def logout! > @request.session[:uid] = nil > end > > def do_logged_in_as(user, &block) > login_as(user) > yield > logout! > end > > def get_roles_and_rights > Right.synchronize_with_controllers > DefaultRights.update > end >> > Fred > > > I still could not fix it this error. I compared line by line the > > config files and the test_helper.rb with a brand new app and there are > > almost the same. Google didn''t provide any clue. > > > Full stack trace here: > > > /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/ > > test_case.rb:17: superclass mismatch for class TestCase (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:in > > `require'' > > from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ > > active_support/dependencies.rb:158:in `require'' > > from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/ > > action_controller/test_case.rb:1 > > 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:in > > `require'' > > from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ > > active_support/dependencies.rb:158:in `require'' > > from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/test_help.rb:6 > > 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:in > > `require'' > > from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ > > active_support/dependencies.rb:158:in `require'' > > from /home/costi/workspace/r2rrails/test/test_helper.rb:3 > > from ./test/unit/customer_test.rb:1:in `require'' > > from ./test/unit/customer_test.rb:1 > > from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ > > rake_test_loader.rb:5:in `load'' > > from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ > > rake_test_loader.rb:5 > > from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ > > rake_test_loader.rb:5:in `each'' > > from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ > > rake_test_loader.rb:5 > > rake aborted!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Constantin Gavrilescu
2009-Apr-07 06:45 UTC
Re: After Rails 2.3.2 upgrade: superclass mismatch for class TestCase (TypeError)
On 6 avr, 17:23, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Apr 6, 11:09 pm, Constantin Gavrilescu > > <comisarulmoldo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I upgraded a working app from rails 2.1 to 2.3.2. Now when I run rake > > test:units I get this error: /usr/lib/ruby/gems/1.8/gems/ > > activesupport-2.3.2/lib/active_support/test_case.rb:17: superclass > > mismatch for class TestCase (TypeError) > > > I generated a new test app and all tests run OK. > > > For the upgrade I ran rake:update and renamed the class in test_helper > > to ActiveSupport::TestCase. Also renamed the classes in all unit tests > > and to inherit from ActiveSupport::TestCase and in functional tests to > > inherit from ActionController::TestCase. > > Looks to me like you accidentally declared a new class called > ActiveSupport::TestCase. You said your test_helper.rb is almost the > same as one in a freshly generated app - what are the differences?There must have been a plugin that changed the class TestCase class. I realized that have done a search and replace in the plugins folder too for Test::Unit::TestCase and replaced it to ActiveSupport::TestCase. I did an svn revert on plugins and the rake test:units don''t show the superclass mismatch for class TestCase error. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Possibly Parallel Threads
- Unit tests - NilClass problem
- assert_valid in unit tests after upgrade to rails 2.3 doesn't work
- undefined method `use_transactional_fixtures=''
- "the number of parameters does not match the number of substitutions" error
- uninitialized constant Test (NameError)