Created
September 26, 2011 21:38
-
-
Save bturnbull/1243484 to your computer and use it in GitHub Desktop.
CoffeeScript Namespacing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### app/assets/javascripts/foo.js.coffee | |
Foo = | |
bar: -> | |
"baz" | |
# Have to add this to get Foo into the global namespace | |
# so Jasmine tests can see it | |
window.Foo = Foo | |
#### spec/javascripts/foo_spec.js.coffee | |
describe "Foo", -> | |
describe "bar", -> | |
it "should return 'baz'", -> | |
expect(Foo.bar).toEqual("baz") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment