Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit de675c57bf6a191e011693f9cb84d5eb742171f8 1 parent 8929e9b
@quangv authored
Showing with 10 additions and 3 deletions.
  1. +1 −1  Readme.md
  2. +9 −2 cakes.coffee
View
2  Readme.md
@@ -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
11 cakes.coffee
@@ -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'])
Please sign in to comment.
Something went wrong with that request. Please try again.