Comparing version 0.0.4 to 0.0.5
@@ -240,6 +240,7 @@ // Generated by CoffeeScript 1.9.1 | ||
describeScenario = function(spec, arg) { | ||
var DONE, GIVEN, THEN, WHEN, bdd, counts, getGiven, getThen, getWhen, getter, lastResult, only, promiseBuilderFactory; | ||
var DONE, GIVEN, THEN, WHEN, bdd, counts, crossCombineResults, getGiven, getThen, getWhen, getter, lastResult, only, promiseBuilderFactory; | ||
only = arg.only, counts = arg.counts; | ||
GIVEN = spec.GIVEN, WHEN = spec.WHEN, THEN = spec.THEN, DONE = spec.DONE; | ||
lastResult = makeResult(); | ||
crossCombineResults = makeResult(); | ||
getter = function(name, collection) { | ||
@@ -253,7 +254,6 @@ return function(description) { | ||
return function(context, extraContext, args) { | ||
var newContext; | ||
var newContext, ref; | ||
newContext = _.extend({}, context, extraContext); | ||
newContext.updateContext(); | ||
args = resolveResultArgs(context, args); | ||
return Q(fn.apply(newContext, args)).then(function(result) { | ||
return Q(fn.apply(newContext, resolveResultArgs((ref = crossCombineResults.get(context)) != null ? ref : {}, args))).then(function(result) { | ||
lastResult.set(newContext, result); | ||
@@ -297,6 +297,10 @@ counts[name].called(description); | ||
promiseBuilder: promiseBuilder, | ||
crossCombineResults: crossCombineResults, | ||
resultTo: function(result) { | ||
assert(result, 'Result must be a promiseBuilder. Create one with bdd.result()'); | ||
return bdd(descriptionBuilder, promiseBuilder.then(function(context) { | ||
result.set(context, lastResult.get(context)); | ||
var ref, results; | ||
results = (ref = crossCombineResults.get(context)) != null ? ref : {}; | ||
result.set(results, lastResult.get(context)); | ||
crossCombineResults.set(context, results); | ||
return context; | ||
@@ -339,3 +343,3 @@ })); | ||
nextPromiseBuilder = promiseBuilder.then(function(context) { | ||
var currentContext, updateContext; | ||
var currentContext, newContext, updateContext; | ||
currentContext = null; | ||
@@ -345,3 +349,3 @@ updateContext = function() { | ||
}; | ||
return rightBdd.promiseBuilder.resolve({ | ||
newContext = { | ||
getContext: (function() { | ||
@@ -351,3 +355,5 @@ return currentContext; | ||
updateContext: updateContext | ||
}); | ||
}; | ||
rightBdd.crossCombineResults.set(newContext, crossCombineResults.get(context)); | ||
return rightBdd.promiseBuilder.resolve(newContext); | ||
}); | ||
@@ -354,0 +360,0 @@ return bdd(descriptionBuilder, nextPromiseBuilder); |
{ | ||
"name": "gwt", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Given, when, then", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13812
377