Permalink
Browse files

Pending options fix. fn refactor

  • Loading branch information...
1 parent a366a9a commit c24f5f07c78a5edd7780a4f1e9b1d2ca4d587f36 @quangv committed Jan 23, 2012
Showing with 13 additions and 7 deletions.
  1. +10 −5 cakes.coffee
  2. +3 −2 package.json
View
@@ -1,6 +1,7 @@
+log = require 'log'
+
colors = require 'colors'
_ = require 'underscore'
-log = require 'log'
exports.Feature = (feature, story..., callback)->
# exp. Feature 'new feature', 'in order to do good', 'as a user', 'I want to do good', ->
@@ -14,8 +15,9 @@ exports.Feature = (feature, story..., callback)->
dic = (type, label, args, options={})-> # Dictate to describe() or it()
- _.extend options,
- padding : false
+ options = _.extend
+ padding:false
+ , options
if type in ['describe', 'it']
if args.length == 1
@@ -30,11 +32,14 @@ dic = (type, label, args, options={})-> # Dictate to describe() or it()
label = '(Pending) '+label
+ fn = ->
+ global[type] label, cb
+
if options.padding
describe '|'.green, ->
- global[type] label, cb
+ fn()
else
- global[type] label, cb
+ fn()
###
View
@@ -3,8 +3,9 @@
, "version" : "0.0.9"
, "author" : "Quang Van <quang@orgnote.com>"
, "homepage" : "https://github.com/quangv/mocha-cakes"
- , "dependencies" : { "colors" : "*",
- "underscore" : "*"
+ , "dependencies" : { "colors" : "*"
+ ,"underscore" : "*"
+ ,"optimist" : "*"
}
, "devDependencies" : { "coffee-script" : "*"
}

0 comments on commit c24f5f0

Please sign in to comment.