Skip to content

Instantly share code, notes, and snippets.

@lamdor
Created November 24, 2010 15:53
Show Gist options
  • Select an option

  • Save lamdor/713855 to your computer and use it in GitHub Desktop.

Select an option

Save lamdor/713855 to your computer and use it in GitHub Desktop.
Promise =
value: () ->
val = null
return () ->
val or= arguments[0]
describe "Promise", ->
it "only returns something when it's been assigned", ->
x = Promise.value()
expect(x()).toBeFalsy()
x(3)
expect(x()).toEqual(3)
this.Promise = Promise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment