From 214c142d9de60a7f53d8c7ada2812ffff4837e0f Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 8 Jan 2010 16:04:35 -0800 Subject: created a way to init the code without autobootstrap --- src/test/Runner.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/test/Runner.js') diff --git a/src/test/Runner.js b/src/test/Runner.js index 478ef73e..c7dd431a 100644 --- a/src/test/Runner.js +++ b/src/test/Runner.js @@ -1,3 +1,5 @@ +if (!nglr.test) nglr.test = {}; + nglr.test.ScenarioRunner = function(scenarios, body) { this.scenarios = scenarios; this.body = body; @@ -46,10 +48,10 @@ nglr.test.Runner.prototype = { scenario:jQuery('
') }; current.run = current.scenario.append( - '
' + - '.' + - '.' + - '.' + + '
' + + '.' + + '.' + + '.' + '').find(".run"); current.log = current.scenario.append('
').find(".log"); current.run.find(".name").text(name); @@ -79,7 +81,7 @@ nglr.test.Runner.prototype = { log.text(buf.join(" ")); this.current.log.append(log); this.console.scrollTop(this.console[0].scrollHeight); - if (level == "error") + if (level == "error") this.current.error = buf.join(" "); } }; @@ -114,16 +116,16 @@ nglr.test.Scenario.prototype = { else if (step.Then) fn = angular.test.THEN[step.Then]; return fn || function (){ throw "ERROR: Need Given/When/Then got: " + nglr.toJson(step); - }; + }; }, context: function(runner) { var frame = runner.frame; var window = frame[0].contentWindow; var document; - if (window.jQuery) + if (window.jQuery) document = window.jQuery(window.document); var context = { - frame:frame, + frame:frame, window:window, log:_.bind(runner.log, runner, "info"), document:document, -- cgit v1.2.3