This project is archived and is in readonly mode.

#1659 ✓resolved
Yaroslav Markin

Gem dependency tests fail on REE/OS X and Mac "default ruby" on OS X

Reported by Yaroslav Markin | December 28th, 2008 @ 08:53 PM | in 2.x


0 tests, 0 assertions, 0 failures, 0 errors
Loaded suite test/gem_dependency_test
Started
.F.........F..F..F
Finished in 0.95556 seconds.

  1) Failure:
test_gem_adds_load_paths(GemDependencyTest) [test/gem_dependency_test.rb:50]:
not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Rails::GemDependency:0x293b050>.gem(#<Gem::Dependency:0x293aa74>)

  2) Failure:
test_gem_loading(GemDependencyTest) [test/gem_dependency_test.rb:61]:
not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Rails::GemDependency:0x414702c>.require('hpricot')
- expected exactly once, not yet invoked: #<Rails::GemDependency:0x414702c>.gem(#<Gem::Dependency:0x4146a50>)

  3) Failure:
test_gem_with_version_adds_load_paths(GemDependencyTest) [test/gem_dependency_test.rb:55]:
not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Rails::GemDependency:0x413d694>.gem(#<Gem::Dependency:0x413d324>)

  4) Failure:
test_gem_without_lib_loading(GemDependencyTest) [test/gem_dependency_test.rb:74]:
not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Rails::GemDependency:0x4134b70>.gem(#<Gem::Dependency:0x4134b84>)
satisfied expectations:
- expected never, not yet invoked: #<Rails::GemDependency:0x4134b70>.require(false)

Comments and changes to this ticket

  • Michael Klishin (antares)

    Michael Klishin (antares) December 29th, 2008 @ 09:15 AM

    • Tag changed from activesupport, bug, gem to activesupport, gem, tests
    • State changed from “new” to “open”
    • Assigned user set to “Michael Klishin (antares)”

    Not just REE and bundled Ruby, but 1.8.6 derivatives.

  • CancelProfileIsBroken

    CancelProfileIsBroken December 29th, 2008 @ 02:05 PM

    Turns out that the OS X/ruby dependency is a red herring. The real issue is hpricot: the tests fail if you have hpricot installed, and pass if you do not, regardless of OS or ruby version.

    That's because after the first successful load of hpricot, GemDependency#framework_gem? returns true, refusing to make any changes to the already-loaded gem.

    We could play games to reset the list of loaded gems, but it seems to me that the simpler fix is to just make sure we use gem names that don't actually exist in our tests. There's already code in there to stub as necessary on systems without hpricot. Patch attached.

  • Yaroslav Markin

    Yaroslav Markin December 29th, 2008 @ 02:10 PM

    • Tag changed from activesupport, gem, tests to activesupport, gem, patch, tests
    • Assigned user changed from “Michael Klishin (antares)” to “Pratik”
  • Manfred Stienstra

    Manfred Stienstra December 29th, 2008 @ 02:38 PM

    Yes, I've noticed this too. And it turns out that on certain installations it's not just the tests failing, but also gem loading in the app process.

  • Repository

    Repository December 29th, 2008 @ 08:01 PM

    • State changed from “open” to “resolved”

    (from [490c26c8433a6d278bc61118782da360e8889646]) Fix failing gem dependency tests [#1659 state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

  • Matt Jones

    Matt Jones December 30th, 2008 @ 05:27 AM

    • State changed from “resolved” to “open”
    • Assigned user changed from “Pratik” to “Matt Jones”

    I checked this out; this is a reoccurrence of the problem we found testing #1128 (comments around 10/27, 9pm); hpricot is getting pulled in as part of builder (by rake), and that messes up gem loading from later on. The problem is only seen with fairly recent dev builds of hpricot that redefine to_xs.

    The tests as written in the patch don't really express what they should with bad gem names, as require shouldn't get called if a gem doesn't exist.

    I'll try to get some more effective tests together by the weekend, probably try avoiding the hpricot problem.

  • Michael Klishin (antares)

    Michael Klishin (antares) December 30th, 2008 @ 05:33 AM

    • Tag changed from activesupport, gem, patch, tests to activesupport, dependencies, gem, patch, tests

    Interesting indeed. Thanks for really digging deep into the problem!

  • Repository

    Repository February 2nd, 2009 @ 07:57 PM

    • State changed from “open” to “resolved”

    (from [860dd77006b66a0b0805e3e6edc6b80739f6fca3]) Fix failing gem dependency tests [#1659 state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

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>

Attachments

Referenced by

Pages