Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

auterequire test

  • Loading branch information...
commit 3221e35369c3e5b18ebcfbe3e9a56a7271439893 1 parent a25ee7f
@gudleik gudleik authored
View
2  lib/assets/javascripts/autoexec_bat.coffee
@@ -1,7 +1,7 @@
AutoexecBat =
topLevel: "App"
debug: false
- # autoRequire: null
+ autoRequire: false
log: (msg) ->
console?.log msg if AutoexecBat.debug
View
11 test/autoexecBatTest.coffee
@@ -48,7 +48,16 @@ describe 'AutoexecBat', ->
autoexec.define 'App.Bar', ["App.Bullshit"], (exports) ->
autoexec.App.Bar.dependencies.should =~ ['App.Bullshit']
- it "autoRequired modules are automatically loaded"
+ describe "autoRequire", ->
+
+ it "should be disabled by default", ->
+ autoexec.AutoexecBat.autoRequire.should.not.be.ok
+ autoexec.App.Foo.dependencies.should.be.empty
+
+ it "autoRequired modules are automatically added to the dependency list", ->
+ autoexec.AutoexecBat.autoRequire = "App.Always"
+ autoexec.define "App.Bar", -> exports.autoexec = -> 'something here'
+ autoexec.App.Bar.dependencies.should.include "App.Always"
describe "require", ->
Please sign in to comment.
Something went wrong with that request. Please try again.