diff --git a/GOALS_2.0.md b/GOALS_2.0.md index cf8d97d7..9198a116 100644 --- a/GOALS_2.0.md +++ b/GOALS_2.0.md @@ -14,9 +14,13 @@ ### Hard * Finish killing Globals - * Guidlines: everything that isn't a CTOR should be closed inside `Env`, and everything that is a CTOR needs to be `new`ed inside the `Env` + * Guidelines: everything that isn't a CTOR should be closed inside `Env`, and everything that is a CTOR needs to be `new`ed inside the `Env` * Spies * jasmine.util should be util closure inside of env or something + * argsToArray is used for Spies and matching + * inherit is for how matchers are added/mixed in, reporters, and pretty printers + * formatException is used only inside Env/spec + * htmlEscape is for messages in matchers - should this be HTML at all? Is that Reporter responsibility? * Suites need to be unit-tested * Remove Queue from Suite in favor of queuerunner refactoring * Remover Runner in favor of a top-level Suite @@ -24,5 +28,12 @@ * get feature parity back on HTMLReporter ### Easy - * Refactor `queuerunner` into a new object - * xdescribe / xit make skipped specs instead of empty blocks +* Refactor `queuerunner` into a new object +* xdescribe / xit make skipped specs instead of empty blocks + +## Other Topics + +* Build - can we, should we redo the build and release process AGAIN in order to make it less arcane +* Docs + * JsDoc is a pain to host and RubyMine is pretty good at navigating. I say we kill it officially + * Docco has gone over well. Should we annotate all the sources and then have Pages be more complex, having tutorials and annotated source like Backbone? Are we small enough? diff --git a/lib/jasmine-core/boot/boot.js b/lib/jasmine-core/boot/boot.js index b0846e29..252f0435 100644 --- a/lib/jasmine-core/boot/boot.js +++ b/lib/jasmine-core/boot/boot.js @@ -48,9 +48,9 @@ }; if (typeof window == "undefined" && typeof exports == "object") { - jasmine.util.extend(exports, jasmineInterface); + extend(exports, jasmineInterface); } else { - jasmine.util.extend(window, jasmineInterface); + extend(window, jasmineInterface); } var htmlReporter = new jasmine.HtmlReporter(null, jasmine, env); @@ -71,4 +71,9 @@ env.execute(); }; + function extend(destination, source) { + for (var property in source) destination[property] = source[property]; + return destination; + } + }()); diff --git a/lib/jasmine-core/jasmine-html.js b/lib/jasmine-core/jasmine-html.js index 020a4327..b4170fb6 100644 --- a/lib/jasmine-core/jasmine-html.js +++ b/lib/jasmine-core/jasmine-html.js @@ -282,6 +282,7 @@ jasmine.HtmlReporter.ReporterView = function(dom, jasmine, catchExceptions) { this.specComplete = function(result) { this.completeSpecCount++; + //TODO: this needs to work in order to get blanks for skipped specs. // if (isUndefined(this.views.specs[result.id])) { // this.views.specs[result.id] = new this.jasmine.HtmlReporter.SpecView(result, dom); // } diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 441b3152..59199582 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -445,11 +445,6 @@ jasmine.util.argsToArray = function(args) { return arrayOfArgs; }; -jasmine.util.extend = function(destination, source) { - for (var property in source) destination[property] = source[property]; - return destination; -}; - //TODO: expectation result may make more sense as a presentation of an expectation. jasmine.buildExpectationResult = function(params) { return { diff --git a/spec/console/ConsoleReporterSpec.js b/spec/console/ConsoleReporterSpec.js index d108c8e3..9b705b42 100644 --- a/spec/console/ConsoleReporterSpec.js +++ b/spec/console/ConsoleReporterSpec.js @@ -124,15 +124,15 @@ describe("ConsoleReporter", function() { }); it("prints the proper output under a failure scenario.", function() { - var base1 = jasmine.util.extend({}, failingSpec), - failingSpec1 = jasmine.util.extend(base1, { + var base1 = extend({}, failingSpec), + failingSpec1 = extend(base1, { fullName: 'The oven heats up', failedExpectations: [ {trace:{stack:"stack trace one\n second line"}}, {trace:{stack:"stack trace two"}} ]}), - base2 = jasmine.util.extend({}, failingSpec), - failingSpec2 = jasmine.util.extend(base2, { + base2 = extend({}, failingSpec), + failingSpec2 = extend(base2, { fullName: "The washing machine washes clothes", failedExpectations: [ {trace:{stack:"stack trace one"}} @@ -284,4 +284,9 @@ describe("ConsoleReporter", function() { }); }); }); + + function extend(destination, source) { + for (var property in source) destination[property] = source[property]; + return destination; + } }); diff --git a/spec/core/UtilSpec.js b/spec/core/UtilSpec.js index 551c2872..17694168 100644 --- a/spec/core/UtilSpec.js +++ b/spec/core/UtilSpec.js @@ -1,26 +1,4 @@ describe("jasmine.util", function() { - describe("extend", function () { - it("should add properies to a destination object ", function() { - var destination = {baz: 'baz'}; - jasmine.util.extend(destination, { - foo: 'foo', bar: 'bar' - }); - expect(destination).toEqual({foo: 'foo', bar: 'bar', baz: 'baz'}); - }); - - it("should replace properies that already exist on a destination object", function() { - var destination = {foo: 'foo'}; - jasmine.util.extend(destination, { - foo: 'bar' - }); - expect(destination).toEqual({foo: 'bar'}); - jasmine.util.extend(destination, { - foo: null - }); - expect(destination).toEqual({foo: null}); - }); - }); - describe("isArray_", function() { it("should return true if the argument is an array", function() { expect(jasmine.isArray_([])).toBe(true); diff --git a/spec/support/dev_boot.js b/spec/support/dev_boot.js index 471ca317..acbfb235 100644 --- a/spec/support/dev_boot.js +++ b/spec/support/dev_boot.js @@ -1,5 +1,2 @@ var originalJasmine = jasmine; -//copy clock methods back into window, -//so second jasmine load doesn't use jasmine clock methods. -jasmine.util.extend(window, jasmine.Clock.real); jasmine = null; diff --git a/src/core/util.js b/src/core/util.js index 067be2bb..fa9dd212 100644 --- a/src/core/util.js +++ b/src/core/util.js @@ -58,10 +58,4 @@ jasmine.util.argsToArray = function(args) { var arrayOfArgs = []; for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]); return arrayOfArgs; -}; - -jasmine.util.extend = function(destination, source) { - for (var property in source) destination[property] = source[property]; - return destination; -}; - +}; \ No newline at end of file