Skip to content

Instantly share code, notes, and snippets.

@mcculloughsean
Created September 17, 2012 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcculloughsean/3739700 to your computer and use it in GitHub Desktop.
Save mcculloughsean/3739700 to your computer and use it in GitHub Desktop.
stubbing
module.exports =
env: process.env.NODE_ENV ? 'development'
config = require './config'
module.exports.foo = () ->
"We're in #{config.env} environment"
config = require './config'
assert config.env, 'development' # true
model = require './model'
assert "We're in development environment", model.foo() #true
config.env = 'production'
assert "We're in production environment", model.foo() #true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment