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.

Mocha is required by setup_and_teardown.rb in all environments and modes

#403

The following code snippet is where it happens. Mocha becomes available in all environments, and also in script/console, script/server, etc.

        begin
          require 'mocha'
          base.alias_method_chain :run, :callbacks_and_mocha
        rescue LoadError
          base.alias_method_chain :run, :callbacks
        end

This could cause other testing frameworks or even test/unit tests to encounter problems as mocha will be included along side whatever mocking framework the user actually is using. This doesn't seem to cause any issues currently, but it definitely should be cleaned up.

Reported by Chad Humphries · June 12th, 2008 @ 04:57 PM

State: wontfix
Milestone: none
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 2.1.1
    • State changed from new to open
    • Assigned user set to Jeremy Kemper

    True. We could gem 'mocha' instead and rescue Gem::LoadError instead.

    June 12th, 2008 @ 05:43 PM

  2. Repository
    Repository
    • State changed from open to resolved

    (from [8636df7b5572b996cee0bfb59f9804825b3030d2]) Check for mocha gem without requiring the lib. [#403 state:resolved]

    http://github.com/rails/rails/co...

    June 23rd, 2008 @ 04:56 AM

  3. Repository
    Repository

    (from [4d5ac3f3d2e1667971752c9a4e536de1a5bec364]) Check for mocha gem without requiring the lib. [#403 state:resolved]

    http://github.com/rails/rails/co...

    June 23rd, 2008 @ 04:56 AM

  4. Repository
    Repository

    (from [642b0e95122c6f748ba0575e6dd3e2eccf34509c]) Revert "Check for mocha gem without requiring the lib. [#403 state:resolved]"

    This reverts commit 8636df7b5572b996cee0bfb59f9804825b3030d2.

    http://github.com/rails/rails/co...

    June 23rd, 2008 @ 08:39 AM

  5. Repository
    Repository

    (from [d7462ea36550bd59cfbcd7961f5870c49bcf8963]) Revert "Check for mocha gem without requiring the lib. [#403 state:resolved]"

    This reverts commit 4d5ac3f3d2e1667971752c9a4e536de1a5bec364.

    http://github.com/rails/rails/co...

    June 23rd, 2008 @ 08:39 AM

  6. Jeremy Kemper
    Jeremy Kemper
    • State changed from resolved to incomplete

    Messes up the setup/teardown override. Since mocha isn't required before it's mixed in.

    June 23rd, 2008 @ 08:44 AM

  7. Jeremy Kemper
  8. John
    John
    • Tag set to activesupport, bug, tests

    This actually is causing problems transitioning our app up to 2.1, just mentioning it so this isn't just treated as a "tidy up" issue.

    If I come up with a solution that isn't halfway hackish I'll submit a patch.

    July 3rd, 2008 @ 02:14 AM

  9. josh
    josh
    • State changed from incomplete to wontfix

    October 5th, 2008 @ 03:14 PM