Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#1659

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)

Reported by Yaroslav Markin · December 28th, 2008 @ 08:53 PM

State: resolved
Milestone: 2.x
Assigned to: Matt Jones Matt Jones
Importance: none

Activity

  1. Michael Klishin (antares)
    Michael Klishin (antares)
    • 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.

    December 29th, 2008 @ 09:15 AM

  2. CancelProfileIsBroken
    CancelProfileIsBroken

    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.

    December 29th, 2008 @ 02:05 PM

  3. Yaroslav Markin
    Yaroslav Markin
    • Tag changed from activesupport, gem, tests to activesupport, gem, patch, tests
    • Assigned user changed from Michael Klishin (antares) to Pratik

    December 29th, 2008 @ 02:10 PM

  4. Manfred Stienstra
    Manfred Stienstra

    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.

    December 29th, 2008 @ 02:38 PM

  5. Repository
    Repository
    • State changed from open to resolved

    (from [490c26c8433a6d278bc61118782da360e8889646]) Fix failing gem dependency tests [#1659 Gem dependency tests fail on REE/OS X and Mac "default ruby" on OS X state:resolved]

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

    December 29th, 2008 @ 08:01 PM

  6. Matt Jones
    Matt Jones
    • 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 Fix config.gem bugs and add more tests (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.

    December 30th, 2008 @ 05:27 AM

  7. Michael Klishin (antares)
    Michael Klishin (antares)
    • Tag changed from activesupport, gem, patch, tests to activesupport, dependencies, gem, patch, tests

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

    December 30th, 2008 @ 05:33 AM

  8. Repository
    Repository
    • State changed from open to resolved

    (from [860dd77006b66a0b0805e3e6edc6b80739f6fca3]) Fix failing gem dependency tests [#1659 Gem dependency tests fail on REE/OS X and Mac "default ruby" on OS X state:resolved]

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

    February 2nd, 2009 @ 07:57 PM