2010-12-29 05:48:54 +00:00
|
|
|
# Importing
|
|
|
|
# ---------
|
|
|
|
|
|
|
|
unless window? or testingBrowser?
|
|
|
|
test "coffeescript modules can be imported and executed", ->
|
|
|
|
|
|
|
|
magicKey = __filename
|
|
|
|
magicValue = 0xFFFF
|
|
|
|
|
|
|
|
if global[magicKey]?
|
|
|
|
if exports?
|
|
|
|
local = magicValue
|
|
|
|
exports.method = -> local
|
|
|
|
else
|
|
|
|
global[magicKey] = {}
|
2012-08-09 00:00:52 +00:00
|
|
|
if require?.extensions?
|
2010-12-29 05:48:54 +00:00
|
|
|
ok require(__filename).method() is magicValue
|
|
|
|
delete global[magicKey]
|