Skip to content

Instantly share code, notes, and snippets.

@deepthawtz
Created March 17, 2009 06:35
Show Gist options
  • Save deepthawtz/80351 to your computer and use it in GitHub Desktop.
Save deepthawtz/80351 to your computer and use it in GitHub Desktop.
# ==== 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