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.

test_help is unusable in an project that has more than one test environment

#5685

http://github.com/rails/rails/blob/aa85a7a7e70ece22728aa3463fc3427c...

abort("Abort testing: Your Rails environment is not running in test mode!") unless Rails.env.test?

This means tests won't run in any environment other than test, which makes multiple testing environments impossible without patching abort or Rails.env.

Reported by David Chelimsky · September 22nd, 2010 @ 09:11 PM

State: resolved
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. David Chelimsky
    David Chelimsky

    Not sure what the best approach is here. We need the flexibility to have multiple test environments, but we also want to help prevent people from doing fun things like blowing away their production databases. How about changing the condition to if Rails.env.production?, and then adding a configurable (as in "I can turn it off") warning when not in the test environment?

    September 22nd, 2010 @ 09:13 PM

  2. José Valim
    José Valim
    • Importance changed from to Low

    Checking for Rails.env.development? or Rails.env.production? sounds good to me.

    September 22nd, 2010 @ 10:34 PM

  3. David Chelimsky
  4. David Chelimsky
  5. José Valim
    José Valim
    • State changed from new to resolved

    Applied, thanks!

    September 24th, 2010 @ 12:09 PM