Permalink
Browse files

System command can be an IT if provided a message, first argument

  • Loading branch information...
1 parent 8929e9b commit de675c57bf6a191e011693f9cb84d5eb742171f8 @quangv committed May 3, 2012
Showing with 10 additions and 3 deletions.
  1. +1 −1 Readme.md
  2. +9 −2 cakes.coffee
View
@@ -32,7 +32,7 @@ Provides high-level/functional/acceptance test organization lingo, using _'Featu
## Grey-Box, System Tests
-`System` (just calls _describe_ with System label, useful for testing (grey box) system resources, database, not directly observable by Customer etc.)
+`System` (if it has a message it'll be an _it_, if not it'll be a _describe_ with System label, useful for testing (grey box) system resources, database, not directly observable by Customer etc.)
## Pretty Commands for Specs/Unit Tests
View
@@ -179,12 +179,19 @@ createDescribe = (options)->
exports.Describe = exports.Spec = createDescribe(['label', 'color'])
createSystem = (options)->
- return (callback)->
+ return (msg, callback)->
label = '[system]'
if 'style' in options
label = label.black.italic
- mocha.describe label, callback
+ # If it has a message, it's an IT, or else it's a describe.
+ if typeof msg is 'function'
+ callback = msg
+ mocha.describe label, callback
+ else
+ label += ' '+msg
+ mocha.it label, callback
+
exports.System = createSystem(['style'])

0 comments on commit de675c5

Please sign in to comment.