Skip to content
Browse files

Added the CONTROLLER_CS and TESTCONTROLLER_CS templates.

  • Loading branch information...
1 parent 52ecea5 commit 5766093e34a63d3e803b2f0014d581693727c0f3 @mr-rock mr-rock committed Mar 11, 2012
Showing with 40 additions and 0 deletions.
  1. +40 −0 .alice/coffeescript
View
40 .alice/coffeescript
@@ -30,6 +30,46 @@ TESTMODULE_CS += "\n\n\tdescribe '\#example', ->\
\n\t\t\tdone()\
\n\t\t\treturn"
+CONTROLLER_CS = "$(NAME) = exports = module.exports = ->\
+\n\t\#value1: 0\
+\n\tvalue2: 0\
+\n\n\t\#method1: ->\
+\n\t\t\# ... your code goes in here ...\
+\n\n\t\t\#return\
+\n\n\tmethod2: ->\
+\n\t\t\# ... your code goes in here ...\
+\n\n\t\treturn"
+
+ifeq "$(GROUP)" ""
+TESTCONTROLLER_CS = "describe '$(NAME)', ->\
+\n\t$(NAME) = require '../../$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(NAME_CAMELIZED)'"
+else
+TESTCONTROLLER_CS = "describe '$(GROUP) > $(NAME)', ->\
+\n\t$(NAME) = require '../../../$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED)/$(NAME_CAMELIZED)'"
+endif
+
+TESTCONTROLLER_CS += "\n\tcontroller = new $(NAME)()\
+\n\n\tdescribe '\#value1', ->\
+\n\t\tit 'should not exist', (done) ->\
+\n\t\t\tcontroller.should.not.have.property 'value1'\
+\n\t\t\tdone()\
+\n\t\t\treturn\
+\n\n\tdescribe '\#value2', ->\
+\n\t\tit 'should exist', (done) ->\
+\n\t\t\tcontroller.should.have.property 'value2'\
+\n\t\t\tdone()\
+\n\t\t\treturn\
+\n\n\tdescribe '\#method1()', ->\
+\n\t\tit 'should not exist', (done) ->\
+\n\t\t\tcontroller.should.not.have.property 'method1'\
+\n\t\t\tdone()\
+\n\t\t\treturn\
+\n\n\tdescribe '\#method2()', ->\
+\n\t\tit 'should exist', (done) ->\
+\n\t\t\tcontroller.should.have.property 'method2'\
+\n\t\t\tdone()\
+\n\t\t\treturn"
+
MODEL_CS = "$(NAME) = exports = module.exports = ->\
\n\tcounter = -1\
\n\n\tindex: 0\

0 comments on commit 5766093

Please sign in to comment.
Something went wrong with that request. Please try again.