From ef88eb9a71ee7666029c4fb5eb731ce2e986cecc Mon Sep 17 00:00:00 2001 From: Andres Ornelas Date: Tue, 27 Jul 2010 17:04:37 -0700 Subject: refactoring done but Expect not working --- test/scenario/DSLSpec.js | 9 ++++----- test/scenario/RunnerSpec.js | 7 +++++++ test/scenario/TestContext.js | 7 +------ 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'test/scenario') diff --git a/test/scenario/DSLSpec.js b/test/scenario/DSLSpec.js index 4d8d1075..533d34ac 100644 --- a/test/scenario/DSLSpec.js +++ b/test/scenario/DSLSpec.js @@ -1,11 +1,9 @@ describe("DSL", function() { - var scenario, runner, $scenario, lastDocument, executeFuture; + var lastDocument, executeFuture, Expect; beforeEach(function() { - scenario = {}; - runner = new angular.scenario.Runner(scenario, _jQuery); - $scenario = scenario.$scenario; + setUpContext(); executeFuture = function(future, html, callback) { lastDocument =_jQuery('
' + html + '
'); _jQuery(document.body).append(lastDocument); @@ -15,6 +13,7 @@ describe("DSL", function() { }; future.behavior.call(specThis, callback || noop); }; + Expect = scenario.expect; }); describe("input", function() { @@ -48,7 +47,7 @@ describe("DSL", function() { expect(future.name).toEqual("repeater '.repeater-row' count"); executeFuture(future, "
a
" + "
b
"); -// Expect(future).toEqual(2); + Expect(future).toEqual(2); }); }); }); diff --git a/test/scenario/RunnerSpec.js b/test/scenario/RunnerSpec.js index f5c152a5..2eb13f7f 100644 --- a/test/scenario/RunnerSpec.js +++ b/test/scenario/RunnerSpec.js @@ -1,7 +1,14 @@ describe('Runner', function() { + var Describe, It, BeforeEach, AfterEach, body; + beforeEach(function() { setUpContext(); + Describe = scenario.describe; + It = scenario.it; + BeforeEach = scenario.beforeEach; + AfterEach = scenario.afterEach; + body = _jQuery('
'); }); describe('describe', function() { diff --git a/test/scenario/TestContext.js b/test/scenario/TestContext.js index 7a7b41e4..ebb40b95 100644 --- a/test/scenario/TestContext.js +++ b/test/scenario/TestContext.js @@ -1,4 +1,4 @@ -var scenario, runner, log, $scenario, Describe, It, body; +var scenario, runner, log, $scenario; function logger(text) { return function(done){ @@ -11,10 +11,5 @@ function setUpContext() { scenario = {}; runner = new angular.scenario.Runner(scenario, _jQuery); $scenario = scenario.$scenario; - Describe = scenario.describe; - BeforeEach = scenario.beforeEach; - AfterEach = scenario.afterEach; - It = scenario.it; log = ''; - body = _jQuery('
'); } -- cgit v1.2.3