diff --git a/HowToRelease.markdown b/HowToRelease.markdown index 21bef82c..ee6d841f 100644 --- a/HowToRelease.markdown +++ b/HowToRelease.markdown @@ -1,5 +1,12 @@ +1. Ensure all specs are green in browsers & Node.js (via rake tasks) +1. Ensure CI is green +1. + + + + ## Development diff --git a/spec/suites/TrivialConsoleReporterSpec.js b/spec/console/TrivialConsoleReporterSpec.js similarity index 100% rename from spec/suites/TrivialConsoleReporterSpec.js rename to spec/console/TrivialConsoleReporterSpec.js diff --git a/spec/suites/BaseSpec.js b/spec/core/BaseSpec.js similarity index 100% rename from spec/suites/BaseSpec.js rename to spec/core/BaseSpec.js diff --git a/spec/suites/CustomMatchersSpec.js b/spec/core/CustomMatchersSpec.js similarity index 100% rename from spec/suites/CustomMatchersSpec.js rename to spec/core/CustomMatchersSpec.js diff --git a/spec/suites/EnvSpec.js b/spec/core/EnvSpec.js similarity index 100% rename from spec/suites/EnvSpec.js rename to spec/core/EnvSpec.js diff --git a/spec/suites/ExceptionsSpec.js b/spec/core/ExceptionsSpec.js similarity index 100% rename from spec/suites/ExceptionsSpec.js rename to spec/core/ExceptionsSpec.js diff --git a/spec/suites/JsApiReporterSpec.js b/spec/core/JsApiReporterSpec.js similarity index 100% rename from spec/suites/JsApiReporterSpec.js rename to spec/core/JsApiReporterSpec.js diff --git a/spec/suites/MatchersSpec.js b/spec/core/MatchersSpec.js similarity index 99% rename from spec/suites/MatchersSpec.js rename to spec/core/MatchersSpec.js index f46f0014..cb58208d 100644 --- a/spec/suites/MatchersSpec.js +++ b/spec/core/MatchersSpec.js @@ -77,13 +77,6 @@ describe("jasmine.Matchers", function() { expect((match(parseInt('5', 10)).toNotEqual(5))).toFail(); }); - it("toEqual with DOM nodes", function() { - var nodeA = document.createElement('div'); - var nodeB = document.createElement('div'); - expect((match(nodeA).toEqual(nodeA))).toPass(); - expect((match(nodeA).toEqual(nodeB))).toFail(); - }); - it("toEqual to build an Expectation Result", function() { var actual = 'a'; var matcher = match(actual); diff --git a/spec/suites/MockClockSpec.js b/spec/core/MockClockSpec.js similarity index 100% rename from spec/suites/MockClockSpec.js rename to spec/core/MockClockSpec.js diff --git a/spec/suites/MultiReporterSpec.js b/spec/core/MultiReporterSpec.js similarity index 100% rename from spec/suites/MultiReporterSpec.js rename to spec/core/MultiReporterSpec.js diff --git a/spec/suites/NestedResultsSpec.js b/spec/core/NestedResultsSpec.js similarity index 100% rename from spec/suites/NestedResultsSpec.js rename to spec/core/NestedResultsSpec.js diff --git a/spec/suites/PrettyPrintSpec.js b/spec/core/PrettyPrintSpec.js similarity index 91% rename from spec/suites/PrettyPrintSpec.js rename to spec/core/PrettyPrintSpec.js index 22cba29c..37f71041 100644 --- a/spec/suites/PrettyPrintSpec.js +++ b/spec/core/PrettyPrintSpec.js @@ -58,12 +58,6 @@ describe("jasmine.pp", function () { } }); - it("should stringify HTML nodes properly", function() { - var sampleNode = document.createElement('div'); - sampleNode.innerHTML = 'foobar'; - expect(jasmine.pp(sampleNode)).toEqual("HTMLNode"); - expect(jasmine.pp({foo: sampleNode})).toEqual("{ foo : HTMLNode }"); - }); it('should not do HTML escaping of strings', function() { expect(jasmine.pp('some html string &', false)).toEqual('\'some html string &\''); diff --git a/spec/suites/QueueSpec.js b/spec/core/QueueSpec.js similarity index 100% rename from spec/suites/QueueSpec.js rename to spec/core/QueueSpec.js diff --git a/spec/suites/ReporterSpec.js b/spec/core/ReporterSpec.js similarity index 100% rename from spec/suites/ReporterSpec.js rename to spec/core/ReporterSpec.js diff --git a/spec/suites/RunnerSpec.js b/spec/core/RunnerSpec.js similarity index 100% rename from spec/suites/RunnerSpec.js rename to spec/core/RunnerSpec.js diff --git a/spec/suites/SpecRunningSpec.js b/spec/core/SpecRunningSpec.js similarity index 100% rename from spec/suites/SpecRunningSpec.js rename to spec/core/SpecRunningSpec.js diff --git a/spec/suites/SpecSpec.js b/spec/core/SpecSpec.js similarity index 100% rename from spec/suites/SpecSpec.js rename to spec/core/SpecSpec.js diff --git a/spec/suites/SpySpec.js b/spec/core/SpySpec.js similarity index 100% rename from spec/suites/SpySpec.js rename to spec/core/SpySpec.js diff --git a/spec/suites/SuiteSpec.js b/spec/core/SuiteSpec.js similarity index 100% rename from spec/suites/SuiteSpec.js rename to spec/core/SuiteSpec.js diff --git a/spec/suites/UtilSpec.js b/spec/core/UtilSpec.js similarity index 100% rename from spec/suites/UtilSpec.js rename to spec/core/UtilSpec.js diff --git a/spec/suites/WaitsForBlockSpec.js b/spec/core/WaitsForBlockSpec.js similarity index 100% rename from spec/suites/WaitsForBlockSpec.js rename to spec/core/WaitsForBlockSpec.js diff --git a/spec/html/MatchersHtmlSpec.js b/spec/html/MatchersHtmlSpec.js new file mode 100644 index 00000000..b528753a --- /dev/null +++ b/spec/html/MatchersHtmlSpec.js @@ -0,0 +1,38 @@ +describe("MatchersSpec - HTML Dependent", function () { + var env, spec; + + beforeEach(function() { + env = new jasmine.Env(); + env.updateInterval = 0; + + var suite = env.describe("suite", function() { + spec = env.it("spec", function() { + }); + }); + spyOn(spec, 'addMatcherResult'); + + this.addMatchers({ + toPass: function() { + return lastResult().passed(); + }, + toFail: function() { + return !lastResult().passed(); + } + }); + }); + + function match(value) { + return spec.expect(value); + } + + function lastResult() { + return spec.addMatcherResult.mostRecentCall.args[0]; + } + + it("toEqual with DOM nodes", function() { + var nodeA = document.createElement('div'); + var nodeB = document.createElement('div'); + expect((match(nodeA).toEqual(nodeA))).toPass(); + expect((match(nodeA).toEqual(nodeB))).toFail(); + }); +}); \ No newline at end of file diff --git a/spec/html/PrettyPrintHtmlSpec.js b/spec/html/PrettyPrintHtmlSpec.js new file mode 100644 index 00000000..46004c7b --- /dev/null +++ b/spec/html/PrettyPrintHtmlSpec.js @@ -0,0 +1,8 @@ +describe("jasmine.pp (HTML Dependent)", function () { + it("should stringify HTML nodes properly", function() { + var sampleNode = document.createElement('div'); + sampleNode.innerHTML = 'foobar'; + expect(jasmine.pp(sampleNode)).toEqual("HTMLNode"); + expect(jasmine.pp({foo: sampleNode})).toEqual("{ foo : HTMLNode }"); + }); +}); diff --git a/spec/suites/TrivialReporterSpec.js b/spec/html/TrivialReporterSpec.js similarity index 100% rename from spec/suites/TrivialReporterSpec.js rename to spec/html/TrivialReporterSpec.js diff --git a/spec/node_suite.js b/spec/node_suite.js index cb6e60f6..1bbc4a0e 100644 --- a/spec/node_suite.js +++ b/spec/node_suite.js @@ -110,7 +110,7 @@ process.argv.forEach(function(arg) { } }); -var specs = jasmine.getAllSpecFiles(__dirname + '/suites', new RegExp(".js$")); +var specs = jasmine.getAllSpecFiles(__dirname, new RegExp(".js$")); var domIndependentSpecs = []; for (var i = 0; i < specs.length; i++) { if (fs.readFileSync(specs[i], "utf8").indexOf("document.createElement") < 0) { diff --git a/spec/runner.html b/spec/runner.html index 8835c63b..aeb23493 100644 --- a/spec/runner.html +++ b/spec/runner.html @@ -14,29 +14,29 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + +