Permalink
Browse files

auterequire test

  • Loading branch information...
1 parent a25ee7f commit 3221e35369c3e5b18ebcfbe3e9a56a7271439893 @gudleik gudleik committed May 21, 2013
Showing with 11 additions and 2 deletions.
  1. +1 −1 lib/assets/javascripts/autoexec_bat.coffee
  2. +10 −1 test/autoexecBatTest.coffee
@@ -1,7 +1,7 @@
AutoexecBat =
topLevel: "App"
debug: false
- # autoRequire: null
+ autoRequire: false
log: (msg) ->
console?.log msg if AutoexecBat.debug
@@ -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", ->

0 comments on commit 3221e35

Please sign in to comment.