Created
March 17, 2009 06:35
-
-
Save deepthawtz/80351 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ==== Returns | |
# Boolean:: True if Merb environment is testing for instance, | |
# Merb is running with RSpec, Test::Unit of other testing facility. | |
# | |
# :api: public | |
def testing? | |
$TESTING ||= env?(:test) || Merb::Config[:testing] | |
end | |
# ... snip ... | |
# Set the environment if it hasn't already been set. | |
Merb.environment ||= ENV["MERB_ENV"] || Merb::Config[:environment] || (Merb.testing? ? "test" : "development") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment