Skip to content

Instantly share code, notes, and snippets.

@phpnode
Created August 27, 2012 08:47
Show Gist options
  • Save phpnode/3486740 to your computer and use it in GitHub Desktop.
Save phpnode/3486740 to your computer and use it in GitHub Desktop.
# Promise to load a file from the file system
# Requirements:
# it "should load aliased files correctly", (done) ->
# app.load("@lib/Invoke.coffee")
# .then (contents) ->
# contents.should.contain "this unique text that you are reading right now"
# done()
# .otherwise (err) ->
# throw err
#
load: (name, refresh = false) =>
if name.charAt(0) is "@"
name = Invoke.aliasPath name
@loader.load name, refresh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment