aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPete Bacon Darwin2013-09-25 09:46:32 +0100
committerPete Bacon Darwin2013-09-25 12:43:03 +0100
commit8d8801f1aeafeac186f93fe5b7c3b79b5378ba76 (patch)
treee4341c420d6d0ec17296e7128b118c7aad92d315
parent301647bf1b6da9303b39b3c8c8a88f15eaf1b7b3 (diff)
downloadangular.js-8d8801f1aeafeac186f93fe5b7c3b79b5378ba76.tar.bz2
fix(ngScenario): fix error message description
-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 801e19fc..44fbde16 100644
--- a/src/ngScenario/Scenario.js
+++ b/src/ngScenario/Scenario.js
@@ -69,16 +69,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);