aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/scenario/Matcher.js8
-rw-r--r--src/scenario/Runner.js3
2 files changed, 6 insertions, 5 deletions
diff --git a/src/scenario/Matcher.js b/src/scenario/Matcher.js
index a4a13285..b9787050 100644
--- a/src/scenario/Matcher.js
+++ b/src/scenario/Matcher.js
@@ -1,10 +1,10 @@
-function Matcher(future, logger) {
- var self = this;
+function Matcher(scope, future, logger) {
+ var self = scope.$scenario = this;
this.logger = logger;
this.future = future;
}
-Matcher.addMatcher = function(name, matcher){
+Matcher.addMatcher = function(name, matcher) {
Matcher.prototype[name] = function(expected) {
var future = this.future;
$scenario.addFuture(
@@ -18,4 +18,4 @@ Matcher.addMatcher = function(name, matcher){
};
};
-Matcher.addMatcher('toEqual', function(a,b){ return a == b; });
+Matcher.addMatcher('toEqual', function(a,b) { return a == b; });
diff --git a/src/scenario/Runner.js b/src/scenario/Runner.js
index 4e5d0f01..13dfbe7d 100644
--- a/src/scenario/Runner.js
+++ b/src/scenario/Runner.js
@@ -8,6 +8,7 @@ angular.scenario.Runner = function(scope, jQuery){
this.scope.$testrun = {done: false, results: []};
var specs = this.specs = {};
+ this.currentSpec = {name: '', futures: []};
var path = [];
this.scope.describe = function(name, body){
path.push(name);
@@ -23,7 +24,7 @@ angular.scenario.Runner = function(scope, jQuery){
afterEach = body;
};
this.scope.expect = function(future) {
- return new Matcher(future, self.logger);
+ return new Matcher(self, future, self.logger);
};
this.scope.it = function(name, body) {
var specName = path.join(' ') + ': it ' + name;