aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/scenario/Matcher.js3
-rw-r--r--test/scenario/DSLSpec.js8
2 files changed, 8 insertions, 3 deletions
diff --git a/src/scenario/Matcher.js b/src/scenario/Matcher.js
index b9787050..326bb948 100644
--- a/src/scenario/Matcher.js
+++ b/src/scenario/Matcher.js
@@ -10,11 +10,12 @@ Matcher.addMatcher = function(name, matcher) {
$scenario.addFuture(
'expect ' + future.name + ' ' + name + ' ' + expected,
function(done){
- if (matcher(future.value, expected))
+ if (!matcher(future.value, expected))
throw "Expected " + expected + ' but was ' + future.value;
done();
}
);
+ dump('future added');
};
};
diff --git a/test/scenario/DSLSpec.js b/test/scenario/DSLSpec.js
index 533d34ac..47bedb80 100644
--- a/test/scenario/DSLSpec.js
+++ b/test/scenario/DSLSpec.js
@@ -46,8 +46,12 @@ describe("DSL", function() {
var future = repeater('.repeater-row').count();
expect(future.name).toEqual("repeater '.repeater-row' count");
executeFuture(future, "<div class='repeater-row'>a</div>" +
- "<div class='repeater-row'>b</div>");
- Expect(future).toEqual(2);
+ "<div class='repeater-row'>b</div>",
+ function(value) {
+ future.fulfill(value);
+ });
+ expect(future.fulfilled).toBeTruthy();
+ expect(future.value).toEqual(2);
});
});
});