This project is archived and is in readonly mode.

#1481 ✓resolved
Andrew Vit

ActionController::Integration::Session is missing Test::Unit::Assertions

Reported by Andrew Vit | November 26th, 2008 @ 02:28 PM | in 2.x

With the edge version, something has changed in the Integration::Session module which prevents Shoulda from loading. I believe this error is with rails, as nothing from Shoulda shows up in the stacktrace.

Reproduce:


rails newapp

## environment.rb
  config.gem "thoughtbot-shoulda", :lib => "shoulda/rails", :source => "http://gems.github.com"

script/console

I worked around it by adding the 'test/unit/assertions' dependency to the top of the integration.rb file. Not sure if this is the correct fix, please review.

Comments and changes to this ticket

  • Andrew Vit

    Andrew Vit November 26th, 2008 @ 09:03 PM

    • Tag changed from assertions, integration_test, regression, testing to assertions, dependencies, gems, testing

    I'm pretty sure the patch I attached is totally naïve. I just looked at the commit log and I see there's a recent change to use autoloading instead of explicit requires...

    For the record, here's what the stack says:

    uninitialized constant Test::Unit::Assertions
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:437:in `load_missing_constant'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:77:in `const_missing'
    /Users/andrew/Sites/edge230/vendor/rails/actionpack/lib/action_controller/integration.rb:14
    /Library/Ruby/Gems/1.8/gems/thoughtbot-shoulda-2.0.5/lib/shoulda/controller.rb:22
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:516:in `new_constants_in'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    /Library/Ruby/Gems/1.8/gems/thoughtbot-shoulda-2.0.5/lib/shoulda/rails.rb:6
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:516:in `new_constants_in'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    /Users/andrew/Sites/edge230/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:94:in `load'
    /Users/andrew/Sites/edge230/config/../vendor/rails/railties/lib/initializer.rb:300:in `load_gems'
    
  • josh

    josh November 27th, 2008 @ 03:16 AM

    • State changed from “new” to “resolved”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages