aboutsummaryrefslogtreecommitdiffstats
path: root/src/ngScenario/Scenario.js
diff options
context:
space:
mode:
authorPete Bacon Darwin2013-09-25 09:46:32 +0100
committerPete Bacon Darwin2013-09-25 09:46:32 +0100
commitf8f8f754b02459bb789247476cc0da63d2d7370f (patch)
tree4ba1dc8e0d85c2e279a4a90b13a07e77aa3af9a2 /src/ngScenario/Scenario.js
parent6c59e770084912d2345e7f83f983092a2d305ae3 (diff)
downloadangular.js-f8f8f754b02459bb789247476cc0da63d2d7370f.tar.bz2
fix(ngScenario): fix error message description
Diffstat (limited to 'src/ngScenario/Scenario.js')
-rw-r--r--src/ngScenario/Scenario.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ngScenario/Scenario.js b/src/ngScenario/Scenario.js
index 36cc7c0c..dda9a9e3 100644
--- a/src/ngScenario/Scenario.js
+++ b/src/ngScenario/Scenario.js
@@ -74,16 +74,17 @@ angular.scenario.dsl = angular.scenario.dsl || function(name, fn) {
*/
angular.scenario.matcher = angular.scenario.matcher || function(name, fn) {
angular.scenario.matcher[name] = function(expected) {
- var prefix = 'expect ' + this.future.name + ' ',
- not = this.inverse && 'not ';
+ var description = this.future.name +
+ (this.inverse ? ' not ' : ' ') + name +
+ ' ' + angular.toJson(expected);
var self = this;
- this.addFuture(prefix + not + name + ' ' + angular.toJson(expected),
+ this.addFuture('expect ' + description,
function(done) {
var error;
self.actual = self.future.value;
if ((self.inverse && fn.call(self, expected)) ||
(!self.inverse && !fn.call(self, expected))) {
- error = 'expected ' + not + name + ' ' + angular.toJson(expected) +
+ error = 'expected ' + description +
' but was ' + angular.toJson(self.actual);
}
done(error);