diff --git a/spec/console/ConsoleReporterSpec.js b/spec/console/ConsoleReporterSpec.js index 8eab0183..7e0c1a4f 100644 --- a/spec/console/ConsoleReporterSpec.js +++ b/spec/console/ConsoleReporterSpec.js @@ -19,7 +19,7 @@ describe("ConsoleReporter", function() { }); it("reports that the suite has started to the console", function() { - var reporter = new j$.ConsoleReporter({ + var reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print }); @@ -30,7 +30,7 @@ describe("ConsoleReporter", function() { it("starts the provided timer when jasmine starts", function() { var timerSpy = jasmine.createSpyObj('timer', ['start']), - reporter = new j$.ConsoleReporter({ + reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print, timer: timerSpy }); @@ -41,7 +41,7 @@ describe("ConsoleReporter", function() { }); it("reports a passing spec as a dot", function() { - var reporter = new j$.ConsoleReporter({ + var reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print }); @@ -51,7 +51,7 @@ describe("ConsoleReporter", function() { }); it("does not report a disabled spec", function() { - var reporter = new j$.ConsoleReporter({ + var reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print }); @@ -61,7 +61,7 @@ describe("ConsoleReporter", function() { }); it("reports a failing spec as an 'F'", function() { - var reporter = new j$.ConsoleReporter({ + var reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print }); @@ -71,7 +71,7 @@ describe("ConsoleReporter", function() { }); it("reports a pending spec as a '*'", function() { - var reporter = new j$.ConsoleReporter({ + var reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print }); @@ -81,7 +81,7 @@ describe("ConsoleReporter", function() { }); it("alerts user if there are no specs", function(){ - var reporter = new j$.ConsoleReporter({ + var reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print }); @@ -94,7 +94,7 @@ describe("ConsoleReporter", function() { it("reports a summary when done (singular spec and time)", function() { var timerSpy = jasmine.createSpyObj('timer', ['start', 'elapsed']), - reporter = new j$.ConsoleReporter({ + reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print, timer: timerSpy }); @@ -114,7 +114,7 @@ describe("ConsoleReporter", function() { it("reports a summary when done (pluralized specs and seconds)", function() { var timerSpy = jasmine.createSpyObj('timer', ['start', 'elapsed']), - reporter = new j$.ConsoleReporter({ + reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print, timer: timerSpy }); @@ -148,7 +148,7 @@ describe("ConsoleReporter", function() { }); it("reports a summary when done that includes stack traces for a failing suite", function() { - var reporter = new j$.ConsoleReporter({ + var reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print }); @@ -182,7 +182,7 @@ describe("ConsoleReporter", function() { beforeEach(function() { onComplete = jasmine.createSpy('onComplete'); - reporter = new j$.ConsoleReporter({ + reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print, onComplete: onComplete }); @@ -210,7 +210,7 @@ describe("ConsoleReporter", function() { describe("with color", function() { it("reports that the suite has started to the console", function() { - var reporter = new j$.ConsoleReporter({ + var reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print, showColors: true }); @@ -221,7 +221,7 @@ describe("ConsoleReporter", function() { }); it("reports a passing spec as a dot", function() { - var reporter = new j$.ConsoleReporter({ + var reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print, showColors: true }); @@ -232,7 +232,7 @@ describe("ConsoleReporter", function() { }); it("does not report a disabled spec", function() { - var reporter = new j$.ConsoleReporter({ + var reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print, showColors: true }); @@ -243,7 +243,7 @@ describe("ConsoleReporter", function() { }); it("reports a failing spec as an 'F'", function() { - var reporter = new j$.ConsoleReporter({ + var reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print, showColors: true }); @@ -254,7 +254,7 @@ describe("ConsoleReporter", function() { }); it("displays all afterAll exceptions", function() { - var reporter = new j$.ConsoleReporter({ + var reporter = new jasmineUnderTest.ConsoleReporter({ print: out.print, showColors: true }); diff --git a/spec/core/CallTrackerSpec.js b/spec/core/CallTrackerSpec.js index c0028ba5..ffccc538 100644 --- a/spec/core/CallTrackerSpec.js +++ b/spec/core/CallTrackerSpec.js @@ -1,6 +1,6 @@ describe("CallTracker", function() { it("tracks that it was called when executed", function() { - var callTracker = new j$.CallTracker(); + var callTracker = new jasmineUnderTest.CallTracker(); expect(callTracker.any()).toBe(false); @@ -10,7 +10,7 @@ describe("CallTracker", function() { }); it("tracks that number of times that it is executed", function() { - var callTracker = new j$.CallTracker(); + var callTracker = new jasmineUnderTest.CallTracker(); expect(callTracker.count()).toEqual(0); @@ -20,7 +20,7 @@ describe("CallTracker", function() { }); it("tracks the params from each execution", function() { - var callTracker = new j$.CallTracker(); + var callTracker = new jasmineUnderTest.CallTracker(); callTracker.track({object: void 0, args: []}); callTracker.track({object: {}, args: [0, "foo"]}); @@ -31,13 +31,13 @@ describe("CallTracker", function() { }); it("returns any empty array when there was no call", function() { - var callTracker = new j$.CallTracker(); + var callTracker = new jasmineUnderTest.CallTracker(); expect(callTracker.argsFor(0)).toEqual([]); }); it("allows access for the arguments for all calls", function() { - var callTracker = new j$.CallTracker(); + var callTracker = new jasmineUnderTest.CallTracker(); callTracker.track({object: {}, args: []}); callTracker.track({object: {}, args: [0, "foo"]}); @@ -46,7 +46,7 @@ describe("CallTracker", function() { }); it("tracks the context and arguments for each call", function() { - var callTracker = new j$.CallTracker(); + var callTracker = new jasmineUnderTest.CallTracker(); callTracker.track({object: {}, args: []}); callTracker.track({object: {}, args: [0, "foo"]}); @@ -57,7 +57,7 @@ describe("CallTracker", function() { }); it("simplifies access to the arguments for the last (most recent) call", function() { - var callTracker = new j$.CallTracker(); + var callTracker = new jasmineUnderTest.CallTracker(); callTracker.track(); callTracker.track({object: {}, args: [0, "foo"]}); @@ -69,13 +69,13 @@ describe("CallTracker", function() { }); it("returns a useful falsy value when there isn't a last (most recent) call", function() { - var callTracker = new j$.CallTracker(); + var callTracker = new jasmineUnderTest.CallTracker(); expect(callTracker.mostRecent()).toBeFalsy(); }); it("simplifies access to the arguments for the first (oldest) call", function() { - var callTracker = new j$.CallTracker(); + var callTracker = new jasmineUnderTest.CallTracker(); callTracker.track({object: {}, args: [0, "foo"]}); @@ -83,14 +83,14 @@ describe("CallTracker", function() { }); it("returns a useful falsy value when there isn't a first (oldest) call", function() { - var callTracker = new j$.CallTracker(); + var callTracker = new jasmineUnderTest.CallTracker(); expect(callTracker.first()).toBeFalsy(); }); it("allows the tracking to be reset", function() { - var callTracker = new j$.CallTracker(); + var callTracker = new jasmineUnderTest.CallTracker(); callTracker.track(); callTracker.track({object: {}, args: [0, "foo"]}); diff --git a/spec/core/ClockSpec.js b/spec/core/ClockSpec.js index 7ed8264a..9afb5731 100644 --- a/spec/core/ClockSpec.js +++ b/spec/core/ClockSpec.js @@ -6,7 +6,7 @@ describe("Clock", function() { delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["scheduleFunction"]), delayedFn = jasmine.createSpy("delayedFn"), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); fakeGlobal.setTimeout(delayedFn, 0); @@ -28,7 +28,7 @@ describe("Clock", function() { delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["removeFunctionWithId"]), delayedFn = jasmine.createSpy("delayedFn"), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); fakeGlobal.clearTimeout("foo"); @@ -50,7 +50,7 @@ describe("Clock", function() { delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["scheduleFunction"]), delayedFn = jasmine.createSpy("delayedFn"), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); fakeGlobal.setInterval(delayedFn, 0); @@ -72,7 +72,7 @@ describe("Clock", function() { delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["removeFunctionWithId"]), delayedFn = jasmine.createSpy("delayedFn"), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); fakeGlobal.clearInterval("foo"); @@ -94,7 +94,7 @@ describe("Clock", function() { fakeGlobal = { setTimeout: originalFakeSetTimeout }, delayedFunctionSchedulerFactory = jasmine.createSpy('delayedFunctionSchedulerFactory'), mockDate = {}, - clock = new j$.Clock(fakeGlobal, delayedFunctionSchedulerFactory, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, delayedFunctionSchedulerFactory, mockDate); fakeGlobal.setTimeout = replacedSetTimeout; @@ -112,7 +112,7 @@ describe("Clock", function() { fakeGlobal = { clearTimeout: originalFakeClearTimeout }, delayedFunctionSchedulerFactory = jasmine.createSpy('delayedFunctionSchedulerFactory'), mockDate = {}, - clock = new j$.Clock(fakeGlobal, delayedFunctionSchedulerFactory, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, delayedFunctionSchedulerFactory, mockDate); fakeGlobal.clearTimeout = replacedClearTimeout; @@ -130,7 +130,7 @@ describe("Clock", function() { fakeGlobal = { setInterval: originalFakeSetInterval }, delayedFunctionSchedulerFactory = jasmine.createSpy('delayedFunctionSchedulerFactory'), mockDate = {}, - clock = new j$.Clock(fakeGlobal, delayedFunctionSchedulerFactory, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, delayedFunctionSchedulerFactory, mockDate); fakeGlobal.setInterval = replacedSetInterval; @@ -148,7 +148,7 @@ describe("Clock", function() { fakeGlobal = { clearInterval: originalFakeClearInterval }, delayedFunctionSchedulerFactory = jasmine.createSpy('delayedFunctionSchedulerFactory'), mockDate = {}, - clock = new j$.Clock(fakeGlobal, delayedFunctionSchedulerFactory, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, delayedFunctionSchedulerFactory, mockDate); fakeGlobal.clearInterval = replacedClearInterval; @@ -174,7 +174,7 @@ describe("Clock", function() { delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["scheduleFunction", "reset"]), delayedFn = jasmine.createSpy("delayedFn"), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); clock.install(); clock.uninstall(); @@ -204,7 +204,7 @@ describe("Clock", function() { delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["scheduleFunction", "reset", "removeFunctionWithId"]), delayedFn = jasmine.createSpy("delayedFn"), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate), + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate), passedFunctionCalled = false; clock.withMock(function() { @@ -251,7 +251,7 @@ describe("Clock", function() { delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["scheduleFunction", "reset", "removeFunctionWithId"]), delayedFn = jasmine.createSpy("delayedFn"), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate), + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate), passedFunctionCalled = false; expect(function() { @@ -294,7 +294,7 @@ describe("Clock", function() { fakeGlobal = { setTimeout: fakeSetTimeout }, delayedFn = jasmine.createSpy('delayedFn'), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); clock.install(); clock.setTimeout(delayedFn, 0, 'a', 'b'); @@ -311,7 +311,7 @@ describe("Clock", function() { fakeGlobal = { setTimeout: fakeSetTimeout }, delayedFn = jasmine.createSpy('delayedFn'), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate), + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate), timeoutId; clock.install(); @@ -326,7 +326,7 @@ describe("Clock", function() { fakeGlobal = { setTimeout: fakeClearTimeout }, delayedFn = jasmine.createSpy('delayedFn'), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); clock.install(); clock.clearTimeout(123); @@ -342,7 +342,7 @@ describe("Clock", function() { fakeGlobal = { setInterval: fakeSetInterval }, delayedFn = jasmine.createSpy('delayedFn'), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); clock.install(); clock.setInterval(delayedFn, 0, 'a', 'b'); @@ -359,7 +359,7 @@ describe("Clock", function() { fakeGlobal = { setInterval: fakeSetInterval }, delayedFn = jasmine.createSpy('delayedFn'), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate), + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate), intervalId; clock.install(); @@ -374,7 +374,7 @@ describe("Clock", function() { fakeGlobal = { setInterval: clearInterval }, delayedFn = jasmine.createSpy('delayedFn'), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); clock.install(); clock.clearInterval(123); @@ -384,7 +384,7 @@ describe("Clock", function() { }); it("gives you a friendly reminder if the Clock is not installed and you tick", function() { - var clock = new j$.Clock({}, jasmine.createSpyObj('delayedFunctionScheduler', ['tick'])); + var clock = new jasmineUnderTest.Clock({}, jasmine.createSpyObj('delayedFunctionScheduler', ['tick'])); expect(function() { clock.tick(50); }).toThrow(); @@ -401,7 +401,7 @@ describe("Clock", function() { setInterval: fakeSetInterval }, mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock(fakeGlobal, function () { return delayedFunctionScheduler; }, mockDate); fakeSetTimeout.apply = null; fakeSetInterval.apply = null; @@ -428,9 +428,9 @@ describe("Clock (acceptance)", function() { delayedFn2 = jasmine.createSpy('delayedFn2'), delayedFn3 = jasmine.createSpy('delayedFn3'), recurring1 = jasmine.createSpy('recurring1'), - delayedFunctionScheduler = new j$.DelayedFunctionScheduler(), + delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock({setTimeout: setTimeout}, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock({setTimeout: setTimeout}, function () { return delayedFunctionScheduler; }, mockDate); clock.install(); @@ -475,9 +475,9 @@ describe("Clock (acceptance)", function() { it("can clear a previously set timeout", function() { var clearedFn = jasmine.createSpy('clearedFn'), - delayedFunctionScheduler = new j$.DelayedFunctionScheduler(), + delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate), + clock = new jasmineUnderTest.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate), timeoutId; clock.install(); @@ -493,9 +493,9 @@ describe("Clock (acceptance)", function() { it("can clear a previously set interval using that interval's handler", function() { var spy = jasmine.createSpy('spy'), - delayedFunctionScheduler = new j$.DelayedFunctionScheduler(), + delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock({setInterval: function() {}}, function () { return delayedFunctionScheduler; }, mockDate), + clock = new jasmineUnderTest.Clock({setInterval: function() {}}, function () { return delayedFunctionScheduler; }, mockDate), intervalId; clock.install(); @@ -511,9 +511,9 @@ describe("Clock (acceptance)", function() { it("correctly schedules functions after the Clock has advanced", function() { var delayedFn1 = jasmine.createSpy('delayedFn1'), - delayedFunctionScheduler = new j$.DelayedFunctionScheduler(), + delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate); clock.install(); @@ -528,9 +528,9 @@ describe("Clock (acceptance)", function() { it("correctly schedules functions while the Clock is advancing", function() { var delayedFn1 = jasmine.createSpy('delayedFn1'), delayedFn2 = jasmine.createSpy('delayedFn2'), - delayedFunctionScheduler = new j$.DelayedFunctionScheduler(), + delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate); delayedFn1.and.callFake(function() { clock.setTimeout(delayedFn2, 0); }); clock.install(); @@ -547,9 +547,9 @@ describe("Clock (acceptance)", function() { it("correctly calls functions scheduled while the Clock is advancing", function() { var delayedFn1 = jasmine.createSpy('delayedFn1'), delayedFn2 = jasmine.createSpy('delayedFn2'), - delayedFunctionScheduler = new j$.DelayedFunctionScheduler(), + delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate); delayedFn1.and.callFake(function() { clock.setTimeout(delayedFn2, 1); }); clock.install(); @@ -563,9 +563,9 @@ describe("Clock (acceptance)", function() { it("correctly schedules functions scheduled while the Clock is advancing but after the Clock is uninstalled", function() { var delayedFn1 = jasmine.createSpy('delayedFn1'), delayedFn2 = jasmine.createSpy('delayedFn2'), - delayedFunctionScheduler = new j$.DelayedFunctionScheduler(), + delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(), mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} }, - clock = new j$.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate); + clock = new jasmineUnderTest.Clock({setTimeout: function() {}}, function () { return delayedFunctionScheduler; }, mockDate); delayedFn1.and.callFake(function() { clock.uninstall(); @@ -585,10 +585,10 @@ describe("Clock (acceptance)", function() { }); it("does not mock the Date object by default", function() { - var delayedFunctionScheduler = new j$.DelayedFunctionScheduler(), + var delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(), global = {Date: Date}, - mockDate = new j$.MockDate(global), - clock = new j$.Clock({setTimeout: setTimeout}, function () { return delayedFunctionScheduler; }, mockDate); + mockDate = new jasmineUnderTest.MockDate(global), + clock = new jasmineUnderTest.Clock({setTimeout: setTimeout}, function () { return delayedFunctionScheduler; }, mockDate); clock.install(); @@ -602,10 +602,10 @@ describe("Clock (acceptance)", function() { }); it("mocks the Date object and sets it to current time", function() { - var delayedFunctionScheduler = new j$.DelayedFunctionScheduler(), + var delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(), global = {Date: Date}, - mockDate = new j$.MockDate(global), - clock = new j$.Clock({setTimeout: setTimeout}, function () { return delayedFunctionScheduler; }, mockDate); + mockDate = new jasmineUnderTest.MockDate(global), + clock = new jasmineUnderTest.Clock({setTimeout: setTimeout}, function () { return delayedFunctionScheduler; }, mockDate); clock.install().mockDate(); @@ -626,10 +626,10 @@ describe("Clock (acceptance)", function() { }); it("mocks the Date object and sets it to a given time", function() { - var delayedFunctionScheduler = new j$.DelayedFunctionScheduler(), + var delayedFunctionScheduler = new jasmineUnderTest.DelayedFunctionScheduler(), global = {Date: Date}, - mockDate = new j$.MockDate(global), - clock = new j$.Clock({setTimeout: setTimeout}, function () { return delayedFunctionScheduler; }, mockDate), + mockDate = new jasmineUnderTest.MockDate(global), + clock = new jasmineUnderTest.Clock({setTimeout: setTimeout}, function () { return delayedFunctionScheduler; }, mockDate), baseTime = new Date(2013, 9, 23); diff --git a/spec/core/DelayedFunctionSchedulerSpec.js b/spec/core/DelayedFunctionSchedulerSpec.js index 9047a0a8..0794bb1e 100644 --- a/spec/core/DelayedFunctionSchedulerSpec.js +++ b/spec/core/DelayedFunctionSchedulerSpec.js @@ -1,6 +1,6 @@ describe("DelayedFunctionScheduler", function() { it("schedules a function for later execution", function() { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), fn = jasmine.createSpy('fn'); scheduler.scheduleFunction(fn, 0); @@ -13,7 +13,7 @@ describe("DelayedFunctionScheduler", function() { }); it("schedules a string for later execution", function() { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), strfn = "horrible = true;"; scheduler.scheduleFunction(strfn, 0); @@ -24,7 +24,7 @@ describe("DelayedFunctionScheduler", function() { }); it("#tick defaults to 0", function() { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), fn = jasmine.createSpy('fn'); scheduler.scheduleFunction(fn, 0); @@ -37,7 +37,7 @@ describe("DelayedFunctionScheduler", function() { }); it("defaults delay to 0", function() { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), fn = jasmine.createSpy('fn'); scheduler.scheduleFunction(fn); @@ -50,7 +50,7 @@ describe("DelayedFunctionScheduler", function() { }); it("optionally passes params to scheduled functions", function() { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), fn = jasmine.createSpy('fn'); scheduler.scheduleFunction(fn, 0, ['foo', 'bar']); @@ -63,7 +63,7 @@ describe("DelayedFunctionScheduler", function() { }); it("scheduled fns can optionally reoccur", function() { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), fn = jasmine.createSpy('fn'); scheduler.scheduleFunction(fn, 20, [], true); @@ -85,7 +85,7 @@ describe("DelayedFunctionScheduler", function() { }); it("increments scheduled fns ids unless one is passed", function() { - var scheduler = new j$.DelayedFunctionScheduler(); + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(); expect(scheduler.scheduleFunction(function() { }, 0)).toBe(1); @@ -98,7 +98,7 @@ describe("DelayedFunctionScheduler", function() { }); it("#removeFunctionWithId removes a previously scheduled function with a given id", function() { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), fn = jasmine.createSpy('fn'), timeoutKey; @@ -114,7 +114,7 @@ describe("DelayedFunctionScheduler", function() { }); it("executes recurring functions interleaved with regular functions in the correct order", function() { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), fn = jasmine.createSpy('fn'), recurringCallCount = 0, recurring = jasmine.createSpy('recurring').and.callFake(function() { @@ -135,7 +135,7 @@ describe("DelayedFunctionScheduler", function() { }); it("schedules a function for later execution during a tick", function () { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), fn = jasmine.createSpy('fn'), fnDelay = 10; @@ -151,7 +151,7 @@ describe("DelayedFunctionScheduler", function() { }); it("#removeFunctionWithId removes a previously scheduled function with a given id during a tick", function () { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), fn = jasmine.createSpy('fn'), fnDelay = 10, timeoutKey; @@ -169,7 +169,7 @@ describe("DelayedFunctionScheduler", function() { }); it("executes recurring functions interleaved with regular functions and functions scheduled during a tick in the correct order", function () { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), fn = jasmine.createSpy('fn'), recurringCallCount = 0, recurring = jasmine.createSpy('recurring').and.callFake(function() { @@ -202,7 +202,7 @@ describe("DelayedFunctionScheduler", function() { }); it("executes recurring functions after rescheduling them", function () { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), recurring = function() { expect(scheduler.scheduleFunction).toHaveBeenCalled(); }; @@ -215,7 +215,7 @@ describe("DelayedFunctionScheduler", function() { }); it("removes functions during a tick that runs the function", function() { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), fn = jasmine.createSpy('fn'), fnDelay = 10, timeoutKey; @@ -234,7 +234,7 @@ describe("DelayedFunctionScheduler", function() { }); it("removes functions during the first tick that runs the function", function() { - var scheduler = new j$.DelayedFunctionScheduler(), + var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(), fn = jasmine.createSpy('fn'), fnDelay = 10, timeoutKey; diff --git a/spec/core/EnvSpec.js b/spec/core/EnvSpec.js index 8cffd067..44bca7fd 100644 --- a/spec/core/EnvSpec.js +++ b/spec/core/EnvSpec.js @@ -2,20 +2,20 @@ describe("Env", function() { var env; beforeEach(function() { - env = new j$.Env(); + env = new jasmineUnderTest.Env(); }); describe("#pending", function() { it("throws the Pending Spec exception", function() { expect(function() { env.pending(); - }).toThrow(j$.Spec.pendingSpecExceptionMessage); + }).toThrow(jasmineUnderTest.Spec.pendingSpecExceptionMessage); }); it("throws the Pending Spec exception with a custom message", function() { expect(function() { env.pending('custom message'); - }).toThrow(j$.Spec.pendingSpecExceptionMessage + 'custom message'); + }).toThrow(jasmineUnderTest.Spec.pendingSpecExceptionMessage + 'custom message'); }); }); @@ -38,9 +38,9 @@ describe("Env", function() { it('can configure specs to throw errors on expectation failures', function() { env.throwOnExpectationFailure(true); - spyOn(j$, 'Spec'); + spyOn(jasmineUnderTest, 'Spec'); env.it('foo', function() {}); - expect(j$.Spec).toHaveBeenCalledWith(jasmine.objectContaining({ + expect(jasmineUnderTest.Spec).toHaveBeenCalledWith(jasmine.objectContaining({ throwOnExpectationFailure: true })); }); @@ -48,9 +48,9 @@ describe("Env", function() { it('can configure suites to throw errors on expectation failures', function() { env.throwOnExpectationFailure(true); - spyOn(j$, 'Suite'); + spyOn(jasmineUnderTest, 'Suite'); env.describe('foo', function() {}); - expect(j$.Suite).toHaveBeenCalledWith(jasmine.objectContaining({ + expect(jasmineUnderTest.Suite).toHaveBeenCalledWith(jasmine.objectContaining({ throwOnExpectationFailure: true })); }); diff --git a/spec/core/ExceptionFormatterSpec.js b/spec/core/ExceptionFormatterSpec.js index 5c4ead71..ef384dd7 100644 --- a/spec/core/ExceptionFormatterSpec.js +++ b/spec/core/ExceptionFormatterSpec.js @@ -7,7 +7,7 @@ describe("ExceptionFormatter", function() { message: 'you got your foo in my bar', name: 'A Classic Mistake' }, - exceptionFormatter = new j$.ExceptionFormatter(), + exceptionFormatter = new jasmineUnderTest.ExceptionFormatter(), message = exceptionFormatter.message(sampleFirefoxException); expect(message).toEqual('A Classic Mistake: you got your foo in my bar in foo.js (line 1978)'); @@ -20,7 +20,7 @@ describe("ExceptionFormatter", function() { message: 'you got your foo in my bar', name: 'A Classic Mistake' }, - exceptionFormatter = new j$.ExceptionFormatter(), + exceptionFormatter = new jasmineUnderTest.ExceptionFormatter(), message = exceptionFormatter.message(sampleWebkitException); expect(message).toEqual('A Classic Mistake: you got your foo in my bar in foo.js (line 1978)'); @@ -31,7 +31,7 @@ describe("ExceptionFormatter", function() { message: 'you got your foo in my bar', name: 'A Classic Mistake' }, - exceptionFormatter = new j$.ExceptionFormatter(), + exceptionFormatter = new jasmineUnderTest.ExceptionFormatter(), message = exceptionFormatter.message(sampleV8); expect(message).toEqual('A Classic Mistake: you got your foo in my bar'); @@ -39,7 +39,7 @@ describe("ExceptionFormatter", function() { it("formats thrown exceptions that aren't errors", function() { var thrown = "crazy error", - exceptionFormatter = new j$.ExceptionFormatter(), + exceptionFormatter = new jasmineUnderTest.ExceptionFormatter(), message = exceptionFormatter.message(thrown); expect(message).toEqual("crazy error thrown"); @@ -53,11 +53,11 @@ describe("ExceptionFormatter", function() { var error; try { throw new Error("an error") } catch(e) { error = e; } - expect(new j$.ExceptionFormatter().stack(error)).toMatch(/ExceptionFormatterSpec\.js.*\d+/) + expect(new jasmineUnderTest.ExceptionFormatter().stack(error)).toMatch(/ExceptionFormatterSpec\.js.*\d+/) }); it("returns null if no Error provided", function() { - expect(new j$.ExceptionFormatter().stack()).toBeNull(); + expect(new jasmineUnderTest.ExceptionFormatter().stack()).toBeNull(); }); }); }); diff --git a/spec/core/ExceptionsSpec.js b/spec/core/ExceptionsSpec.js index 954f834e..ba770457 100644 --- a/spec/core/ExceptionsSpec.js +++ b/spec/core/ExceptionsSpec.js @@ -2,7 +2,7 @@ describe('Exceptions:', function() { var env; beforeEach(function() { - env = new j$.Env(); + env = new jasmineUnderTest.Env(); }); describe('with break on exception', function() { diff --git a/spec/core/ExpectationResultSpec.js b/spec/core/ExpectationResultSpec.js index 5787827e..41785287 100644 --- a/spec/core/ExpectationResultSpec.js +++ b/spec/core/ExpectationResultSpec.js @@ -1,16 +1,16 @@ describe("buildExpectationResult", function() { it("defaults to passed", function() { - var result = j$.buildExpectationResult({passed: 'some-value'}); + var result = jasmineUnderTest.buildExpectationResult({passed: 'some-value'}); expect(result.passed).toBe('some-value'); }); it("message defaults to Passed for passing specs", function() { - var result = j$.buildExpectationResult({passed: true, message: 'some-value'}); + var result = jasmineUnderTest.buildExpectationResult({passed: true, message: 'some-value'}); expect(result.message).toBe('Passed.'); }); it("message returns the message for failing expectations", function() { - var result = j$.buildExpectationResult({passed: false, message: 'some-value'}); + var result = jasmineUnderTest.buildExpectationResult({passed: false, message: 'some-value'}); expect(result.message).toBe('some-value'); }); @@ -18,7 +18,7 @@ describe("buildExpectationResult", function() { var fakeError = {message: 'foo'}, messageFormatter = jasmine.createSpy("exception message formatter").and.returnValue(fakeError.message); - var result = j$.buildExpectationResult( + var result = jasmineUnderTest.buildExpectationResult( { passed: false, error: fakeError, @@ -33,7 +33,7 @@ describe("buildExpectationResult", function() { var fakeError = {stack: 'foo'}, stackFormatter = jasmine.createSpy("stack formatter").and.returnValue(fakeError.stack); - var result = j$.buildExpectationResult( + var result = jasmineUnderTest.buildExpectationResult( { passed: false, error: fakeError, @@ -45,17 +45,17 @@ describe("buildExpectationResult", function() { }); it("matcherName returns passed matcherName", function() { - var result = j$.buildExpectationResult({matcherName: 'some-value'}); + var result = jasmineUnderTest.buildExpectationResult({matcherName: 'some-value'}); expect(result.matcherName).toBe('some-value'); }); it("expected returns passed expected", function() { - var result = j$.buildExpectationResult({expected: 'some-value'}); + var result = jasmineUnderTest.buildExpectationResult({expected: 'some-value'}); expect(result.expected).toBe('some-value'); }); it("actual returns passed actual", function() { - var result = j$.buildExpectationResult({actual: 'some-value'}); + var result = jasmineUnderTest.buildExpectationResult({actual: 'some-value'}); expect(result.actual).toBe('some-value'); }); }); diff --git a/spec/core/ExpectationSpec.js b/spec/core/ExpectationSpec.js index b253672b..18cb3921 100644 --- a/spec/core/ExpectationSpec.js +++ b/spec/core/ExpectationSpec.js @@ -6,7 +6,7 @@ describe("Expectation", function() { }, expectation; - expectation = new j$.Expectation({ + expectation = new jasmineUnderTest.Expectation({ customMatchers: matchers }); @@ -20,18 +20,18 @@ describe("Expectation", function() { }, expectation; - j$.Expectation.addCoreMatchers(coreMatchers); + jasmineUnderTest.Expectation.addCoreMatchers(coreMatchers); - expectation = new j$.Expectation({}); + expectation = new jasmineUnderTest.Expectation({}); expect(expectation.toQuux).toBeDefined(); }); it("Factory builds an expectation/negative expectation", function() { - var builtExpectation = j$.Expectation.Factory(); + var builtExpectation = jasmineUnderTest.Expectation.Factory(); - expect(builtExpectation instanceof j$.Expectation).toBe(true); - expect(builtExpectation.not instanceof j$.Expectation).toBe(true); + expect(builtExpectation instanceof jasmineUnderTest.Expectation).toBe(true); + expect(builtExpectation.not instanceof jasmineUnderTest.Expectation).toBe(true); expect(builtExpectation.not.isNot).toBe(true); }); @@ -46,7 +46,7 @@ describe("Expectation", function() { addExpectationResult = jasmine.createSpy("addExpectationResult"), expectation; - expectation = new j$.Expectation({ + expectation = new jasmineUnderTest.Expectation({ util: util, customMatchers: matchers, customEqualityTesters: customEqualityTesters, @@ -74,7 +74,7 @@ describe("Expectation", function() { addExpectationResult = jasmine.createSpy("addExpectationResult"), expectation; - expectation = new j$.Expectation({ + expectation = new jasmineUnderTest.Expectation({ util: util, customMatchers: matchers, actual: "an actual", @@ -100,7 +100,7 @@ describe("Expectation", function() { addExpectationResult = jasmine.createSpy("addExpectationResult"), expectation; - expectation = new j$.Expectation({ + expectation = new jasmineUnderTest.Expectation({ customMatchers: matchers, util: util, actual: "an actual", @@ -132,7 +132,7 @@ describe("Expectation", function() { addExpectationResult = jasmine.createSpy("addExpectationResult"), expectation; - expectation = new j$.Expectation({ + expectation = new jasmineUnderTest.Expectation({ customMatchers: matchers, util: util, actual: "an actual", @@ -166,7 +166,7 @@ describe("Expectation", function() { addExpectationResult = jasmine.createSpy("addExpectationResult"), expectation; - expectation = new j$.Expectation({ + expectation = new jasmineUnderTest.Expectation({ actual: "an actual", customMatchers: matchers, addExpectationResult: addExpectationResult @@ -199,7 +199,7 @@ describe("Expectation", function() { addExpectationResult = jasmine.createSpy("addExpectationResult"), expectation; - expectation = new j$.Expectation({ + expectation = new jasmineUnderTest.Expectation({ customMatchers: matchers, actual: "an actual", addExpectationResult: addExpectationResult @@ -231,7 +231,7 @@ describe("Expectation", function() { actual = "an actual", expectation; - expectation = new j$.Expectation({ + expectation = new jasmineUnderTest.Expectation({ customMatchers: matchers, actual: "an actual", addExpectationResult: addExpectationResult, @@ -264,7 +264,7 @@ describe("Expectation", function() { actual = "an actual", expectation; - expectation = new j$.Expectation({ + expectation = new jasmineUnderTest.Expectation({ customMatchers: matchers, actual: "an actual", util: util, @@ -300,7 +300,7 @@ describe("Expectation", function() { actual = "an actual", expectation; - expectation = new j$.Expectation({ + expectation = new jasmineUnderTest.Expectation({ customMatchers: matchers, actual: "an actual", addExpectationResult: addExpectationResult, @@ -331,7 +331,7 @@ describe("Expectation", function() { actual = "an actual", expectation; - expectation = new j$.Expectation({ + expectation = new jasmineUnderTest.Expectation({ customMatchers: matchers, actual: "an actual", addExpectationResult: addExpectationResult, @@ -367,7 +367,7 @@ describe("Expectation", function() { actual = "an actual", expectation; - expectation = new j$.Expectation({ + expectation = new jasmineUnderTest.Expectation({ customMatchers: matchers, actual: "an actual", addExpectationResult: addExpectationResult, diff --git a/spec/core/JsApiReporterSpec.js b/spec/core/JsApiReporterSpec.js index 99ad905c..8e6564d8 100644 --- a/spec/core/JsApiReporterSpec.js +++ b/spec/core/JsApiReporterSpec.js @@ -5,7 +5,7 @@ xdescribe('JsApiReporter (integration specs)', function() { var suite, nestedSuite, nestedSpec; beforeEach(function() { - env = new j$.Env(); + env = new jasmineUnderTest.Env(); suite = env.describe("top-level suite", function() { spec1 = env.it("spec 1", function() { @@ -25,7 +25,7 @@ xdescribe('JsApiReporter (integration specs)', function() { }); - reporter = new j$.JsApiReporter({}); + reporter = new jasmineUnderTest.JsApiReporter({}); env.addReporter(reporter); env.execute(); @@ -82,7 +82,7 @@ xdescribe('JsApiReporter (integration specs)', function() { describe("JsApiReporter", function() { it("knows when a full environment is started", function() { - var reporter = new j$.JsApiReporter({}); + var reporter = new jasmineUnderTest.JsApiReporter({}); expect(reporter.started).toBe(false); expect(reporter.finished).toBe(false); @@ -94,7 +94,7 @@ describe("JsApiReporter", function() { }); it("knows when a full environment is done", function() { - var reporter = new j$.JsApiReporter({}); + var reporter = new jasmineUnderTest.JsApiReporter({}); expect(reporter.started).toBe(false); expect(reporter.finished).toBe(false); @@ -106,13 +106,13 @@ describe("JsApiReporter", function() { }); it("defaults to 'loaded' status", function() { - var reporter = new j$.JsApiReporter({}); + var reporter = new jasmineUnderTest.JsApiReporter({}); expect(reporter.status()).toEqual('loaded'); }); it("reports 'started' when Jasmine has started", function() { - var reporter = new j$.JsApiReporter({}); + var reporter = new jasmineUnderTest.JsApiReporter({}); reporter.jasmineStarted(); @@ -120,7 +120,7 @@ describe("JsApiReporter", function() { }); it("reports 'done' when Jasmine is done", function() { - var reporter = new j$.JsApiReporter({}); + var reporter = new jasmineUnderTest.JsApiReporter({}); reporter.jasmineDone({}); @@ -128,7 +128,7 @@ describe("JsApiReporter", function() { }); it("tracks a suite", function() { - var reporter = new j$.JsApiReporter({}); + var reporter = new jasmineUnderTest.JsApiReporter({}); reporter.suiteStarted({ id: 123, @@ -151,7 +151,7 @@ describe("JsApiReporter", function() { describe("#specResults", function() { var reporter, specResult1, specResult2; beforeEach(function() { - reporter = new j$.JsApiReporter({}); + reporter = new jasmineUnderTest.JsApiReporter({}); specResult1 = { id: 1, description: "A spec" @@ -181,7 +181,7 @@ describe("JsApiReporter", function() { describe("#suiteResults", function(){ var reporter, suiteResult1, suiteResult2; beforeEach(function() { - reporter = new j$.JsApiReporter({}); + reporter = new jasmineUnderTest.JsApiReporter({}); suiteStarted1 = { id: 1 }; @@ -218,7 +218,7 @@ describe("JsApiReporter", function() { describe("#executionTime", function() { it("should start the timer when jasmine starts", function() { var timerSpy = jasmine.createSpyObj('timer', ['start', 'elapsed']), - reporter = new j$.JsApiReporter({ + reporter = new jasmineUnderTest.JsApiReporter({ timer: timerSpy }); @@ -228,7 +228,7 @@ describe("JsApiReporter", function() { it("should return the time it took the specs to run, in ms", function() { var timerSpy = jasmine.createSpyObj('timer', ['start', 'elapsed']), - reporter = new j$.JsApiReporter({ + reporter = new jasmineUnderTest.JsApiReporter({ timer: timerSpy }); @@ -240,7 +240,7 @@ describe("JsApiReporter", function() { describe("when the specs haven't finished being run", function() { it("should return undefined", function() { var timerSpy = jasmine.createSpyObj('timer', ['start', 'elapsed']), - reporter = new j$.JsApiReporter({ + reporter = new jasmineUnderTest.JsApiReporter({ timer: timerSpy }); @@ -251,7 +251,7 @@ describe("JsApiReporter", function() { describe('#runDetails', function() { it('should have details about the run', function() { - var reporter = new j$.JsApiReporter({}); + var reporter = new jasmineUnderTest.JsApiReporter({}); reporter.jasmineDone({some: {run: 'details'}}); expect(reporter.runDetails).toEqual({some: {run: 'details'}}); }); diff --git a/spec/core/MockDateSpec.js b/spec/core/MockDateSpec.js index f8f3bb56..cc4ae816 100644 --- a/spec/core/MockDateSpec.js +++ b/spec/core/MockDateSpec.js @@ -1,7 +1,7 @@ describe("FakeDate", function() { it("does not fail if no global date is found", function() { var fakeGlobal = {}, - mockDate = new j$.MockDate(fakeGlobal); + mockDate = new jasmineUnderTest.MockDate(fakeGlobal); expect(function() { mockDate.install(); @@ -17,7 +17,7 @@ describe("FakeDate", function() { } }), fakeGlobal = { Date: globalDate }, - mockDate = new j$.MockDate(fakeGlobal); + mockDate = new jasmineUnderTest.MockDate(fakeGlobal); expect(fakeGlobal.Date).toEqual(globalDate); mockDate.install(); @@ -32,7 +32,7 @@ describe("FakeDate", function() { } }), fakeGlobal = { Date: globalDate }, - mockDate = new j$.MockDate(fakeGlobal); + mockDate = new jasmineUnderTest.MockDate(fakeGlobal); mockDate.install(); mockDate.uninstall(); @@ -49,7 +49,7 @@ describe("FakeDate", function() { } }), fakeGlobal = { Date: globalDate }, - mockDate = new j$.MockDate(fakeGlobal); + mockDate = new jasmineUnderTest.MockDate(fakeGlobal); mockDate.install(); @@ -60,7 +60,7 @@ describe("FakeDate", function() { it("can accept a date as time base when installing", function() { var fakeGlobal = { Date: Date }, - mockDate = new j$.MockDate(fakeGlobal), + mockDate = new jasmineUnderTest.MockDate(fakeGlobal), baseDate = new Date(); spyOn(baseDate, 'getTime').and.returnValue(123); @@ -71,7 +71,7 @@ describe("FakeDate", function() { it("makes real dates", function() { var fakeGlobal = { Date: Date }, - mockDate = new j$.MockDate(fakeGlobal); + mockDate = new jasmineUnderTest.MockDate(fakeGlobal); mockDate.install(); expect(new fakeGlobal.Date()).toEqual(jasmine.any(Date)); @@ -89,7 +89,7 @@ describe("FakeDate", function() { fakeGlobal = { Date: globalDate }; globalDate.now = function() {}; - var mockDate = new j$.MockDate(fakeGlobal); + var mockDate = new jasmineUnderTest.MockDate(fakeGlobal); mockDate.install(); @@ -105,7 +105,7 @@ describe("FakeDate", function() { } }), fakeGlobal = { Date: globalDate }, - mockDate = new j$.MockDate(fakeGlobal); + mockDate = new jasmineUnderTest.MockDate(fakeGlobal); mockDate.install(); @@ -123,7 +123,7 @@ describe("FakeDate", function() { fakeGlobal = { Date: globalDate }; globalDate.now = function() {}; - var mockDate = new j$.MockDate(fakeGlobal); + var mockDate = new jasmineUnderTest.MockDate(fakeGlobal); mockDate.install(); @@ -147,7 +147,7 @@ describe("FakeDate", function() { fakeGlobal = { Date: globalDate }; globalDate.now = function() {}; - var mockDate = new j$.MockDate(fakeGlobal); + var mockDate = new jasmineUnderTest.MockDate(fakeGlobal); mockDate.install(); @@ -160,7 +160,7 @@ describe("FakeDate", function() { it("allows creation of a Date in a different time than the mocked time", function() { var fakeGlobal = { Date: Date }, - mockDate = new j$.MockDate(fakeGlobal); + mockDate = new jasmineUnderTest.MockDate(fakeGlobal); mockDate.install(); @@ -170,7 +170,7 @@ describe("FakeDate", function() { it("allows creation of a Date that isn't fully specified", function() { var fakeGlobal = { Date: Date }, - mockDate = new j$.MockDate(fakeGlobal); + mockDate = new jasmineUnderTest.MockDate(fakeGlobal); mockDate.install(); @@ -180,7 +180,7 @@ describe("FakeDate", function() { it('allows creation of a Date with millis', function() { var fakeGlobal = { Date: Date }, - mockDate = new j$.MockDate(fakeGlobal), + mockDate = new jasmineUnderTest.MockDate(fakeGlobal), now = new Date(2014, 3, 15).getTime(); mockDate.install(); @@ -191,7 +191,7 @@ describe("FakeDate", function() { it("copies all Date properties to the mocked date", function() { var fakeGlobal = { Date: Date }, - mockDate = new j$.MockDate(fakeGlobal); + mockDate = new jasmineUnderTest.MockDate(fakeGlobal); mockDate.install(); diff --git a/spec/core/PrettyPrintSpec.js b/spec/core/PrettyPrintSpec.js index 6d818a8f..7290db01 100644 --- a/spec/core/PrettyPrintSpec.js +++ b/spec/core/PrettyPrintSpec.js @@ -1,34 +1,34 @@ -describe("j$.pp", function () { +describe("jasmineUnderTest.pp", function () { it("should wrap strings in single quotes", function() { - expect(j$.pp("some string")).toEqual("'some string'"); - expect(j$.pp("som' string")).toEqual("'som' string'"); + expect(jasmineUnderTest.pp("some string")).toEqual("'some string'"); + expect(jasmineUnderTest.pp("som' string")).toEqual("'som' string'"); }); it("should stringify primitives properly", function() { - expect(j$.pp(true)).toEqual("true"); - expect(j$.pp(false)).toEqual("false"); - expect(j$.pp(null)).toEqual("null"); - expect(j$.pp(jasmine.undefined)).toEqual("undefined"); - expect(j$.pp(3)).toEqual("3"); - expect(j$.pp(-3.14)).toEqual("-3.14"); - expect(j$.pp(-0)).toEqual("-0"); + expect(jasmineUnderTest.pp(true)).toEqual("true"); + expect(jasmineUnderTest.pp(false)).toEqual("false"); + expect(jasmineUnderTest.pp(null)).toEqual("null"); + expect(jasmineUnderTest.pp(jasmine.undefined)).toEqual("undefined"); + expect(jasmineUnderTest.pp(3)).toEqual("3"); + expect(jasmineUnderTest.pp(-3.14)).toEqual("-3.14"); + expect(jasmineUnderTest.pp(-0)).toEqual("-0"); }); describe('stringify arrays', function() { it("should stringify arrays properly", function() { - expect(j$.pp([1, 2])).toEqual("[ 1, 2 ]"); - expect(j$.pp([1, 'foo', {}, jasmine.undefined, null])).toEqual("[ 1, 'foo', Object({ }), undefined, null ]"); + expect(jasmineUnderTest.pp([1, 2])).toEqual("[ 1, 2 ]"); + expect(jasmineUnderTest.pp([1, 'foo', {}, jasmine.undefined, null])).toEqual("[ 1, 'foo', Object({ }), undefined, null ]"); }); - it("should truncate arrays that are longer than j$.MAX_PRETTY_PRINT_ARRAY_LENGTH", function() { - var originalMaxLength = j$.MAX_PRETTY_PRINT_ARRAY_LENGTH; + it("should truncate arrays that are longer than jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH", function() { + var originalMaxLength = jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH; var array = [1, 2, 3]; try { - j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = 2; - expect(j$.pp(array)).toEqual("[ 1, 2, ... ]"); + jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH = 2; + expect(jasmineUnderTest.pp(array)).toEqual("[ 1, 2, ... ]"); } finally { - j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = originalMaxLength; + jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH = originalMaxLength; } }); @@ -36,27 +36,27 @@ describe("j$.pp", function () { var arr = [1, 2]; arr.foo = 'bar'; arr.baz = {}; - expect(j$.pp(arr)).toEqual("[ 1, 2, foo: 'bar', baz: Object({ }) ]"); + expect(jasmineUnderTest.pp(arr)).toEqual("[ 1, 2, foo: 'bar', baz: Object({ }) ]"); }); it("should stringify empty arrays with properties properly", function() { var empty = []; empty.foo = 'bar'; empty.baz = {}; - expect(j$.pp(empty)).toEqual("[ foo: 'bar', baz: Object({ }) ]"); + expect(jasmineUnderTest.pp(empty)).toEqual("[ foo: 'bar', baz: Object({ }) ]"); }); it("should stringify long arrays with properties properly", function() { - var originalMaxLength = j$.MAX_PRETTY_PRINT_ARRAY_LENGTH; + var originalMaxLength = jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH; var long = [1,2,3]; long.foo = 'bar'; long.baz = {}; try { - j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = 2; - expect(j$.pp(long)).toEqual("[ 1, 2, ..., foo: 'bar', baz: Object({ }) ]"); + jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH = 2; + expect(jasmineUnderTest.pp(long)).toEqual("[ 1, 2, ..., foo: 'bar', baz: Object({ }) ]"); } finally { - j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = originalMaxLength; + jasmineUnderTest.MAX_PRETTY_PRINT_ARRAY_LENGTH = originalMaxLength; } }); @@ -64,19 +64,19 @@ describe("j$.pp", function () { var array1 = [1, 2]; var array2 = [array1]; array1.push(array2); - expect(j$.pp(array1)).toEqual("[ 1, 2, [ ] ]"); + expect(jasmineUnderTest.pp(array1)).toEqual("[ 1, 2, [ ] ]"); }); it("should not indicate circular references incorrectly", function() { var array = [ [1] ]; - expect(j$.pp(array)).toEqual("[ [ 1 ] ]"); + expect(jasmineUnderTest.pp(array)).toEqual("[ [ 1 ] ]"); }); }); it("should stringify objects properly", function() { - expect(j$.pp({foo: 'bar'})).toEqual("Object({ foo: 'bar' })"); - expect(j$.pp({foo:'bar', baz:3, nullValue: null, undefinedValue: jasmine.undefined})).toEqual("Object({ foo: 'bar', baz: 3, nullValue: null, undefinedValue: undefined })"); - expect(j$.pp({foo: function () { + expect(jasmineUnderTest.pp({foo: 'bar'})).toEqual("Object({ foo: 'bar' })"); + expect(jasmineUnderTest.pp({foo:'bar', baz:3, nullValue: null, undefinedValue: jasmine.undefined})).toEqual("Object({ foo: 'bar', baz: 3, nullValue: null, undefinedValue: undefined })"); + expect(jasmineUnderTest.pp({foo: function () { }, bar: [1, 2, 3]})).toEqual("Object({ foo: Function, bar: [ 1, 2, 3 ] })"); }); @@ -85,28 +85,28 @@ describe("j$.pp", function () { SomeClass.prototype.foo = "inherited foo"; var instance = new SomeClass(); instance.bar = "my own bar"; - expect(j$.pp(instance)).toEqual("SomeClass({ bar: 'my own bar' })"); + expect(jasmineUnderTest.pp(instance)).toEqual("SomeClass({ bar: 'my own bar' })"); }); - it("should not recurse objects and arrays more deeply than j$.MAX_PRETTY_PRINT_DEPTH", function() { - var originalMaxDepth = j$.MAX_PRETTY_PRINT_DEPTH; + it("should not recurse objects and arrays more deeply than jasmineUnderTest.MAX_PRETTY_PRINT_DEPTH", function() { + var originalMaxDepth = jasmineUnderTest.MAX_PRETTY_PRINT_DEPTH; var nestedObject = { level1: { level2: { level3: { level4: "leaf" } } } }; var nestedArray = [1, [2, [3, [4, "leaf"]]]]; try { - j$.MAX_PRETTY_PRINT_DEPTH = 2; - expect(j$.pp(nestedObject)).toEqual("Object({ level1: Object({ level2: Object }) })"); - expect(j$.pp(nestedArray)).toEqual("[ 1, [ 2, Array ] ]"); + jasmineUnderTest.MAX_PRETTY_PRINT_DEPTH = 2; + expect(jasmineUnderTest.pp(nestedObject)).toEqual("Object({ level1: Object({ level2: Object }) })"); + expect(jasmineUnderTest.pp(nestedArray)).toEqual("[ 1, [ 2, Array ] ]"); - j$.MAX_PRETTY_PRINT_DEPTH = 3; - expect(j$.pp(nestedObject)).toEqual("Object({ level1: Object({ level2: Object({ level3: Object }) }) })"); - expect(j$.pp(nestedArray)).toEqual("[ 1, [ 2, [ 3, Array ] ] ]"); + jasmineUnderTest.MAX_PRETTY_PRINT_DEPTH = 3; + expect(jasmineUnderTest.pp(nestedObject)).toEqual("Object({ level1: Object({ level2: Object({ level3: Object }) }) })"); + expect(jasmineUnderTest.pp(nestedArray)).toEqual("[ 1, [ 2, [ 3, Array ] ] ]"); - j$.MAX_PRETTY_PRINT_DEPTH = 4; - expect(j$.pp(nestedObject)).toEqual("Object({ level1: Object({ level2: Object({ level3: Object({ level4: 'leaf' }) }) }) })"); - expect(j$.pp(nestedArray)).toEqual("[ 1, [ 2, [ 3, [ 4, 'leaf' ] ] ] ]"); + jasmineUnderTest.MAX_PRETTY_PRINT_DEPTH = 4; + expect(jasmineUnderTest.pp(nestedObject)).toEqual("Object({ level1: Object({ level2: Object({ level3: Object({ level4: 'leaf' }) }) }) })"); + expect(jasmineUnderTest.pp(nestedArray)).toEqual("[ 1, [ 2, [ 3, [ 4, 'leaf' ] ] ] ]"); } finally { - j$.MAX_PRETTY_PRINT_DEPTH = originalMaxDepth; + jasmineUnderTest.MAX_PRETTY_PRINT_DEPTH = originalMaxDepth; } }); @@ -115,18 +115,18 @@ describe("j$.pp", function () { var frozenObject = {foo: {bar: 'baz'}}; frozenObject.circular = frozenObject; frozenObject = Object.freeze(frozenObject); - expect(j$.pp(frozenObject)).toEqual("Object({ foo: Object({ bar: 'baz' }), circular: })"); + expect(jasmineUnderTest.pp(frozenObject)).toEqual("Object({ foo: Object({ bar: 'baz' }), circular: })"); } }); it("should stringify RegExp objects properly", function() { - expect(j$.pp(/x|y|z/)).toEqual("/x|y|z/"); + expect(jasmineUnderTest.pp(/x|y|z/)).toEqual("/x|y|z/"); }); it("should indicate circular object references", function() { var sampleValue = {foo: 'hello'}; sampleValue.nested = sampleValue; - expect(j$.pp(sampleValue)).toEqual("Object({ foo: 'hello', nested: })"); + expect(jasmineUnderTest.pp(sampleValue)).toEqual("Object({ foo: 'hello', nested: })"); }); it("should indicate getters on objects as such", function() { @@ -138,39 +138,39 @@ describe("j$.pp", function () { }); } if (sampleValue.__defineGetter__) { - expect(j$.pp(sampleValue)).toEqual("Object({ id: 1, calculatedValue: })"); + expect(jasmineUnderTest.pp(sampleValue)).toEqual("Object({ id: 1, calculatedValue: })"); } else { - expect(j$.pp(sampleValue)).toEqual("Object({ id: 1 })"); + expect(jasmineUnderTest.pp(sampleValue)).toEqual("Object({ id: 1 })"); } }); it('should not do HTML escaping of strings', function() { - expect(j$.pp('some html string &', false)).toEqual('\'some html string &\''); + expect(jasmineUnderTest.pp('some html string &', false)).toEqual('\'some html string &\''); }); it("should abbreviate the global (usually window) object", function() { - expect(j$.pp(jasmine.getGlobal())).toEqual(""); + expect(jasmineUnderTest.pp(jasmine.getGlobal())).toEqual(""); }); it("should stringify Date objects properly", function() { var now = new Date(); - expect(j$.pp(now)).toEqual("Date(" + now.toString() + ")"); + expect(jasmineUnderTest.pp(now)).toEqual("Date(" + now.toString() + ")"); }); it("should stringify spy objects properly", function() { var TestObject = { someFunction: function() {} }, - env = new j$.Env(); + env = new jasmineUnderTest.Env(); - var spyRegistry = new j$.SpyRegistry({currentSpies: function() {return [];}}); + var spyRegistry = new jasmineUnderTest.SpyRegistry({currentSpies: function() {return [];}}); spyRegistry.spyOn(TestObject, 'someFunction'); - expect(j$.pp(TestObject.someFunction)).toEqual("spy on someFunction"); + expect(jasmineUnderTest.pp(TestObject.someFunction)).toEqual("spy on someFunction"); - expect(j$.pp(j$.createSpy("something"))).toEqual("spy on something"); + expect(jasmineUnderTest.pp(jasmineUnderTest.createSpy("something"))).toEqual("spy on something"); }); it("should stringify objects that implement jasmineToString", function () { @@ -178,7 +178,7 @@ describe("j$.pp", function () { jasmineToString: function () { return "strung"; } }; - expect(j$.pp(obj)).toEqual("strung"); + expect(jasmineUnderTest.pp(obj)).toEqual("strung"); }); it("should stringify objects that implement custom toString", function () { @@ -186,7 +186,7 @@ describe("j$.pp", function () { toString: function () { return "my toString"; } }; - expect(j$.pp(obj)).toEqual("my toString"); + expect(jasmineUnderTest.pp(obj)).toEqual("my toString"); }); it("should handle objects with null prototype", function() { @@ -195,6 +195,6 @@ describe("j$.pp", function () { var obj = Object.create(null); obj.foo = 'bar'; - expect(j$.pp(obj)).toEqual("null({ foo: 'bar' })"); + expect(jasmineUnderTest.pp(obj)).toEqual("null({ foo: 'bar' })"); }); }); diff --git a/spec/core/QueueRunnerSpec.js b/spec/core/QueueRunnerSpec.js index 5e96be6e..e81b811f 100644 --- a/spec/core/QueueRunnerSpec.js +++ b/spec/core/QueueRunnerSpec.js @@ -4,7 +4,7 @@ describe("QueueRunner", function() { var calls = [], queueableFn1 = { fn: jasmine.createSpy('fn1') }, queueableFn2 = { fn: jasmine.createSpy('fn2') }, - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [queueableFn1, queueableFn2] }); queueableFn1.fn.and.callFake(function() { @@ -23,7 +23,7 @@ describe("QueueRunner", function() { var queueableFn1 = { fn: jasmine.createSpy('fn1') }, queueableFn2 = { fn: jasmine.createSpy('fn2') }, queueableFn3 = { fn: function(done) { asyncContext = this; done(); } }, - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [queueableFn1, queueableFn2, queueableFn3] }), asyncContext; @@ -65,7 +65,7 @@ describe("QueueRunner", function() { afterCallback(); setTimeout(done, 100); } }, - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [queueableFn1, queueableFn2, queueableFn3], onComplete: onComplete }); @@ -99,7 +99,7 @@ describe("QueueRunner", function() { } }, queueableFn2 = { fn: jasmine.createSpy('fn2') }, failFn = jasmine.createSpy('fail'), - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [queueableFn1, queueableFn2], fail: failFn }); @@ -121,7 +121,7 @@ describe("QueueRunner", function() { queueableFn = { fn: jasmine.createSpy('fn'), type: 'queueable' }, onComplete = jasmine.createSpy('onComplete'), onException = jasmine.createSpy('onException'), - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [beforeFn, queueableFn], onComplete: onComplete, onException: onException @@ -142,7 +142,7 @@ describe("QueueRunner", function() { queueableFn = { fn: jasmine.createSpy('fn') }, onComplete = jasmine.createSpy('onComplete'), onException = jasmine.createSpy('onException'), - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [beforeFn, queueableFn], onComplete: onComplete, onException: onException, @@ -151,7 +151,7 @@ describe("QueueRunner", function() { queueRunner.execute(); expect(queueableFn.fn).not.toHaveBeenCalled(); - jasmine.clock().tick(j$.DEFAULT_TIMEOUT_INTERVAL); + jasmine.clock().tick(jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL); expect(onException).not.toHaveBeenCalled(); expect(queueableFn.fn).not.toHaveBeenCalled(); @@ -162,7 +162,7 @@ describe("QueueRunner", function() { var queueableFn = { fn: function(done) { throw new Error("error!"); } }, onComplete = jasmine.createSpy('onComplete'), onException = jasmine.createSpy('onException'), - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [queueableFn], onComplete: onComplete, onException: onException @@ -173,7 +173,7 @@ describe("QueueRunner", function() { expect(onComplete).toHaveBeenCalled(); expect(onException).toHaveBeenCalled(); - jasmine.clock().tick(j$.DEFAULT_TIMEOUT_INTERVAL); + jasmine.clock().tick(jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL); expect(onException.calls.count()).toEqual(1); }); @@ -181,7 +181,7 @@ describe("QueueRunner", function() { var queueableFn = { fn: function(done) { done(); } }, onComplete = jasmine.createSpy('onComplete'), onException = jasmine.createSpy('onException'), - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [queueableFn], onComplete: onComplete, onException: onException @@ -191,14 +191,14 @@ describe("QueueRunner", function() { expect(onComplete).toHaveBeenCalled(); - jasmine.clock().tick(j$.DEFAULT_TIMEOUT_INTERVAL); + jasmine.clock().tick(jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL); expect(onException).not.toHaveBeenCalled(); }); it("only moves to the next spec the first time you call done", function() { var queueableFn = { fn: function(done) {done(); done();} }, nextQueueableFn = { fn: jasmine.createSpy('nextFn') }; - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [queueableFn, nextQueueableFn] }); @@ -212,7 +212,7 @@ describe("QueueRunner", function() { throw new Error('error!'); } }, nextQueueableFn = { fn: jasmine.createSpy('nextFn') }; - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [queueableFn, nextQueueableFn] }); @@ -228,7 +228,7 @@ describe("QueueRunner", function() { throw new Error('fake error'); } }, onExceptionCallback = jasmine.createSpy('on exception callback'), - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [queueableFn], onException: onExceptionCallback }); @@ -242,7 +242,7 @@ describe("QueueRunner", function() { var queueableFn = { fn: function() { throw new Error('fake error'); } }, - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [queueableFn], catchException: function(e) { return false; } }); @@ -255,7 +255,7 @@ describe("QueueRunner", function() { it("continues running the functions even after an exception is thrown in an async spec", function() { var queueableFn = { fn: function(done) { throw new Error("error"); } }, nextQueueableFn = { fn: jasmine.createSpy("nextFunction") }, - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [queueableFn, nextQueueableFn] }); @@ -266,7 +266,7 @@ describe("QueueRunner", function() { it("calls a provided complete callback when done", function() { var queueableFn = { fn: jasmine.createSpy('fn') }, completeCallback = jasmine.createSpy('completeCallback'), - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [queueableFn], onComplete: completeCallback }); @@ -281,7 +281,7 @@ describe("QueueRunner", function() { afterFn = { fn: jasmine.createSpy('afterFn') }, completeCallback = jasmine.createSpy('completeCallback'), clearStack = jasmine.createSpy('clearStack'), - queueRunner = new j$.QueueRunner({ + queueRunner = new jasmineUnderTest.QueueRunner({ queueableFns: [asyncFn, afterFn], clearStack: clearStack, onComplete: completeCallback diff --git a/spec/core/ReportDispatcherSpec.js b/spec/core/ReportDispatcherSpec.js index 98a9854f..21224821 100644 --- a/spec/core/ReportDispatcherSpec.js +++ b/spec/core/ReportDispatcherSpec.js @@ -1,7 +1,7 @@ describe("ReportDispatcher", function() { it("builds an interface of requested methods", function() { - var dispatcher = new j$.ReportDispatcher(['foo', 'bar', 'baz']); + var dispatcher = new jasmineUnderTest.ReportDispatcher(['foo', 'bar', 'baz']); expect(dispatcher.foo).toBeDefined(); expect(dispatcher.bar).toBeDefined(); @@ -9,7 +9,7 @@ describe("ReportDispatcher", function() { }); it("dispatches requested methods to added reporters", function() { - var dispatcher = new j$.ReportDispatcher(['foo', 'bar']), + var dispatcher = new jasmineUnderTest.ReportDispatcher(['foo', 'bar']), reporter = jasmine.createSpyObj('reporter', ['foo', 'bar']), anotherReporter = jasmine.createSpyObj('reporter', ['foo', 'bar']); @@ -28,7 +28,7 @@ describe("ReportDispatcher", function() { }); it("does not dispatch to a reporter if the reporter doesn't accept the method", function() { - var dispatcher = new j$.ReportDispatcher(['foo']), + var dispatcher = new jasmineUnderTest.ReportDispatcher(['foo']), reporter = jasmine.createSpyObj('reporter', ['baz']); dispatcher.addReporter(reporter); diff --git a/spec/core/SpecSpec.js b/spec/core/SpecSpec.js index b16d03f1..913a54fb 100644 --- a/spec/core/SpecSpec.js +++ b/spec/core/SpecSpec.js @@ -1,36 +1,36 @@ describe("Spec", function() { it("#isPendingSpecException returns true for a pending spec exception", function() { - var e = new Error(j$.Spec.pendingSpecExceptionMessage); + var e = new Error(jasmineUnderTest.Spec.pendingSpecExceptionMessage); - expect(j$.Spec.isPendingSpecException(e)).toBe(true); + expect(jasmineUnderTest.Spec.isPendingSpecException(e)).toBe(true); }); it("#isPendingSpecException returns true for a pending spec exception (even when FF bug is present)", function() { var fakeError = { - toString: function() { return "Error: " + j$.Spec.pendingSpecExceptionMessage; } + toString: function() { return "Error: " + jasmineUnderTest.Spec.pendingSpecExceptionMessage; } }; - expect(j$.Spec.isPendingSpecException(fakeError)).toBe(true); + expect(jasmineUnderTest.Spec.isPendingSpecException(fakeError)).toBe(true); }); it("#isPendingSpecException returns true for a pending spec exception with a custom message", function() { - expect(j$.Spec.isPendingSpecException(j$.Spec.pendingSpecExceptionMessage + 'foo')).toBe(true); + expect(jasmineUnderTest.Spec.isPendingSpecException(jasmineUnderTest.Spec.pendingSpecExceptionMessage + 'foo')).toBe(true); }); it("#isPendingSpecException returns false for not a pending spec exception", function() { var e = new Error("foo"); - expect(j$.Spec.isPendingSpecException(e)).toBe(false); + expect(jasmineUnderTest.Spec.isPendingSpecException(e)).toBe(false); }); it("#isPendingSpecException returns false for thrown values that don't have toString", function() { - expect(j$.Spec.isPendingSpecException(void 0)).toBe(false); + expect(jasmineUnderTest.Spec.isPendingSpecException(void 0)).toBe(false); }); it("delegates execution to a QueueRunner", function() { var fakeQueueRunner = jasmine.createSpy('fakeQueueRunner'), - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ description: 'my test', id: 'some-id', queueableFn: { fn: function() {} }, @@ -45,7 +45,7 @@ describe("Spec", function() { it("should call the start callback on execution", function() { var fakeQueueRunner = jasmine.createSpy('fakeQueueRunner'), startCallback = jasmine.createSpy('startCallback'), - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ id: 123, description: 'foo bar', queueableFn: { fn: function() {} }, @@ -69,7 +69,7 @@ describe("Spec", function() { startCallback = jasmine.createSpy('start-callback').and.callFake(function() { expect(beforesWereCalled).toBe(false); }), - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ queueableFn: { fn: function() {} }, beforeFns: function() { return [function() { @@ -93,7 +93,7 @@ describe("Spec", function() { expect(before).toHaveBeenCalled(); expect(after).not.toHaveBeenCalled(); }) }, - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ queueableFn: queueableFn, beforeAndAfterFns: function() { return {befores: [before], afters: [after]} @@ -112,7 +112,7 @@ describe("Spec", function() { startCallback = jasmine.createSpy('startCallback'), resultCallback = jasmine.createSpy('resultCallback'), - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ onStart: startCallback, queueableFn: { fn: null }, resultCallback: resultCallback, @@ -127,7 +127,7 @@ describe("Spec", function() { startCallback = jasmine.createSpy('startCallback'), specBody = jasmine.createSpy('specBody'), resultCallback = jasmine.createSpy('resultCallback'), - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ onStart:startCallback, queueableFn: { fn: specBody }, resultCallback: resultCallback, @@ -152,7 +152,7 @@ describe("Spec", function() { startCallback = jasmine.createSpy('startCallback'), specBody = jasmine.createSpy('specBody'), resultCallback = jasmine.createSpy('resultCallback'), - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ onStart:startCallback, queueableFn: { fn: specBody }, resultCallback: resultCallback, @@ -174,7 +174,7 @@ describe("Spec", function() { var fakeQueueRunner = jasmine.createSpy('fakeQueueRunner'), startCallback = jasmine.createSpy('startCallback'), resultCallback = jasmine.createSpy('resultCallback'), - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ onStart: startCallback, resultCallback: resultCallback, description: "with a spec", @@ -207,7 +207,7 @@ describe("Spec", function() { it("should call the done callback on execution complete", function() { var done = jasmine.createSpy('done callback'), - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ queueableFn: { fn: function() {} }, catchExceptions: function() { return false; }, resultCallback: function() {}, @@ -220,18 +220,18 @@ describe("Spec", function() { }); it("#status returns passing by default", function() { - var spec = new j$.Spec({queueableFn: { fn: jasmine.createSpy("spec body")} }); + var spec = new jasmineUnderTest.Spec({queueableFn: { fn: jasmine.createSpy("spec body")} }); expect(spec.status()).toBe('passed'); }); it("#status returns passed if all expectations in the spec have passed", function() { - var spec = new j$.Spec({queueableFn: { fn: jasmine.createSpy("spec body")} }); + var spec = new jasmineUnderTest.Spec({queueableFn: { fn: jasmine.createSpy("spec body")} }); spec.addExpectationResult(true); expect(spec.status()).toBe('passed'); }); it("#status returns failed if any expectations in the spec have failed", function() { - var spec = new j$.Spec({queueableFn: { fn: jasmine.createSpy("spec body") } }); + var spec = new jasmineUnderTest.Spec({queueableFn: { fn: jasmine.createSpy("spec body") } }); spec.addExpectationResult(true); spec.addExpectationResult(false); expect(spec.status()).toBe('failed'); @@ -239,7 +239,7 @@ describe("Spec", function() { it("keeps track of passed and failed expectations", function() { var resultCallback = jasmine.createSpy('resultCallback'), - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ queueableFn: { fn: jasmine.createSpy("spec body") }, expectationResultFactory: function (data) { return data; }, queueRunnerFactory: function(attrs) { attrs.onComplete(); }, @@ -256,7 +256,7 @@ describe("Spec", function() { it("throws an ExpectationFailed error upon receiving a failed expectation when 'throwOnExpectationFailure' is set", function() { var resultCallback = jasmine.createSpy('resultCallback'), - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ queueableFn: { fn: function() {} }, expectationResultFactory: function(data) { return data; }, queueRunnerFactory: function(attrs) { attrs.onComplete(); }, @@ -267,7 +267,7 @@ describe("Spec", function() { spec.addExpectationResult(true, 'passed'); expect(function() { spec.addExpectationResult(false, 'failed') - }).toThrowError(j$.errors.ExpectationFailed); + }).toThrowError(jasmineUnderTest.errors.ExpectationFailed); spec.execute(); @@ -277,7 +277,7 @@ describe("Spec", function() { it("does not throw an ExpectationFailed error when handling an error", function() { var resultCallback = jasmine.createSpy('resultCallback'), - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ queueableFn: { fn: function() {} }, expectationResultFactory: function(data) { return data; }, queueRunnerFactory: function(attrs) { attrs.onComplete(); }, @@ -291,7 +291,7 @@ describe("Spec", function() { it("can return its full name", function() { var specNameSpy = jasmine.createSpy('specNameSpy').and.returnValue('expected val'); - var spec = new j$.Spec({ + var spec = new jasmineUnderTest.Spec({ getSpecName: specNameSpy, queueableFn: { fn: null } }); @@ -303,9 +303,9 @@ describe("Spec", function() { describe("when a spec is marked pending during execution", function() { it("should mark the spec as pending", function() { var fakeQueueRunner = function(opts) { - opts.onException(new Error(j$.Spec.pendingSpecExceptionMessage)); + opts.onException(new Error(jasmineUnderTest.Spec.pendingSpecExceptionMessage)); }, - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ description: 'my test', id: 'some-id', queueableFn: { fn: function() { } }, @@ -320,9 +320,9 @@ describe("Spec", function() { it("should set the pendingReason", function() { var fakeQueueRunner = function(opts) { - opts.onException(new Error(j$.Spec.pendingSpecExceptionMessage + 'custom message')); + opts.onException(new Error(jasmineUnderTest.Spec.pendingSpecExceptionMessage + 'custom message')); }, - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ description: 'my test', id: 'some-id', queueableFn: { fn: function() { } }, @@ -338,7 +338,7 @@ describe("Spec", function() { it("should log a failure when handling an exception", function() { var resultCallback = jasmine.createSpy('resultCallback'), - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ queueableFn: { fn: function() {} }, expectationResultFactory: function(data) { return data; }, queueRunnerFactory: function(attrs) { attrs.onComplete(); }, @@ -359,41 +359,41 @@ describe("Spec", function() { it("should not log an additional failure when handling an ExpectationFailed error", function() { var resultCallback = jasmine.createSpy('resultCallback'), - spec = new j$.Spec({ + spec = new jasmineUnderTest.Spec({ queueableFn: { fn: function() {} }, expectationResultFactory: function(data) { return data; }, queueRunnerFactory: function(attrs) { attrs.onComplete(); }, resultCallback: resultCallback }); - spec.onException(new j$.errors.ExpectationFailed()); + spec.onException(new jasmineUnderTest.errors.ExpectationFailed()); spec.execute(); expect(resultCallback.calls.first().args[0].failedExpectations).toEqual([]); }); it("retrieves a result with updated status", function() { - var spec = new j$.Spec({ queueableFn: { fn: function() {} } }); + var spec = new jasmineUnderTest.Spec({ queueableFn: { fn: function() {} } }); expect(spec.getResult().status).toBe('passed'); }); it("retrives a result with disabled status", function() { - var spec = new j$.Spec({ queueableFn: { fn: function() {} } }); + var spec = new jasmineUnderTest.Spec({ queueableFn: { fn: function() {} } }); spec.disable(); expect(spec.getResult().status).toBe('disabled'); }); it("retrives a result with pending status", function() { - var spec = new j$.Spec({ queueableFn: { fn: function() {} } }); + var spec = new jasmineUnderTest.Spec({ queueableFn: { fn: function() {} } }); spec.pend(); expect(spec.getResult().status).toBe('pending'); }); it("should not be executable when disabled", function() { - var spec = new j$.Spec({ + var spec = new jasmineUnderTest.Spec({ queueableFn: { fn: function() {} } }); spec.disable(); @@ -402,7 +402,7 @@ describe("Spec", function() { }); it("should be executable when pending", function() { - var spec = new j$.Spec({ + var spec = new jasmineUnderTest.Spec({ queueableFn: { fn: function() {} } }); spec.pend(); @@ -411,7 +411,7 @@ describe("Spec", function() { }); it("should be executable when not disabled or pending", function() { - var spec = new j$.Spec({ + var spec = new jasmineUnderTest.Spec({ queueableFn: { fn: function() {} } }); diff --git a/spec/core/SpyRegistrySpec.js b/spec/core/SpyRegistrySpec.js index faa79071..0511e2a8 100644 --- a/spec/core/SpyRegistrySpec.js +++ b/spec/core/SpyRegistrySpec.js @@ -1,14 +1,14 @@ describe("SpyRegistry", function() { describe("#spyOn", function() { it("checks for the existence of the object", function() { - var spyRegistry = new j$.SpyRegistry(); + var spyRegistry = new jasmineUnderTest.SpyRegistry(); expect(function() { spyRegistry.spyOn(void 0, 'pants'); }).toThrowError(/could not find an object/); }); it("checks that a method name was passed", function() { - var spyRegistry = new j$.SpyRegistry(), + var spyRegistry = new jasmineUnderTest.SpyRegistry(), subject = {}; expect(function() { @@ -17,7 +17,7 @@ describe("SpyRegistry", function() { }); it("checks for the existence of the method", function() { - var spyRegistry = new j$.SpyRegistry(), + var spyRegistry = new jasmineUnderTest.SpyRegistry(), subject = {}; expect(function() { @@ -27,7 +27,7 @@ describe("SpyRegistry", function() { it("checks if it has already been spied upon", function() { var spies = [], - spyRegistry = new j$.SpyRegistry({currentSpies: function() { return spies; }}), + spyRegistry = new jasmineUnderTest.SpyRegistry({currentSpies: function() { return spies; }}), subject = { spiedFunc: function() {} }; spyRegistry.spyOn(subject, 'spiedFunc'); @@ -54,7 +54,7 @@ describe("SpyRegistry", function() { }); var spies = [], - spyRegistry = new j$.SpyRegistry({currentSpies: function() { return spies; }}), + spyRegistry = new jasmineUnderTest.SpyRegistry({currentSpies: function() { return spies; }}), subject = { spiedFunc: scope.myFunc }; expect(function() { @@ -68,7 +68,7 @@ describe("SpyRegistry", function() { it("overrides the method on the object and returns the spy", function() { var originalFunctionWasCalled = false, - spyRegistry = new j$.SpyRegistry(), + spyRegistry = new jasmineUnderTest.SpyRegistry(), subject = { spiedFunc: function() { originalFunctionWasCalled = true; } }; var spy = spyRegistry.spyOn(subject, 'spiedFunc'); @@ -80,7 +80,7 @@ describe("SpyRegistry", function() { describe("#clearSpies", function() { it("restores the original functions on the spied-upon objects", function() { var spies = [], - spyRegistry = new j$.SpyRegistry({currentSpies: function() { return spies; }}), + spyRegistry = new jasmineUnderTest.SpyRegistry({currentSpies: function() { return spies; }}), originalFunction = function() {}, subject = { spiedFunc: originalFunction }; diff --git a/spec/core/SpySpec.js b/spec/core/SpySpec.js index 1262e328..a5f9105e 100644 --- a/spec/core/SpySpec.js +++ b/spec/core/SpySpec.js @@ -9,7 +9,7 @@ describe('Spies', function () { }); it("preserves the properties of the spied function", function() { - var spy = j$.createSpy(TestClass.prototype, TestClass.prototype.someFunction); + var spy = jasmineUnderTest.createSpy(TestClass.prototype, TestClass.prototype.someFunction); expect(spy.bob).toEqual("test"); }); @@ -18,19 +18,19 @@ describe('Spies', function () { TestClass.prototype.someFunction.and = "turkey"; expect(function() { - j$.createSpy(TestClass.prototype, TestClass.prototype.someFunction); + jasmineUnderTest.createSpy(TestClass.prototype, TestClass.prototype.someFunction); }).toThrowError("Jasmine spies would overwrite the 'and' and 'calls' properties on the object being spied upon"); }); it("adds a spyStrategy and callTracker to the spy", function() { - var spy = j$.createSpy(TestClass.prototype, TestClass.prototype.someFunction); + var spy = jasmineUnderTest.createSpy(TestClass.prototype, TestClass.prototype.someFunction); - expect(spy.and).toEqual(jasmine.any(j$.SpyStrategy)); - expect(spy.calls).toEqual(jasmine.any(j$.CallTracker)); + expect(spy.and).toEqual(jasmine.any(jasmineUnderTest.SpyStrategy)); + expect(spy.calls).toEqual(jasmine.any(jasmineUnderTest.CallTracker)); }); it("tracks the argument of calls", function () { - var spy = j$.createSpy(TestClass.prototype, TestClass.prototype.someFunction); + var spy = jasmineUnderTest.createSpy(TestClass.prototype, TestClass.prototype.someFunction); var trackSpy = spyOn(spy.calls, "track"); spy("arg"); @@ -39,7 +39,7 @@ describe('Spies', function () { }); it("tracks the context of calls", function () { - var spy = j$.createSpy(TestClass.prototype, TestClass.prototype.someFunction); + var spy = jasmineUnderTest.createSpy(TestClass.prototype, TestClass.prototype.someFunction); var trackSpy = spyOn(spy.calls, "track"); var contextObject = { spyMethod: spy }; @@ -49,7 +49,7 @@ describe('Spies', function () { }); it("tracks the return value of calls", function () { - var spy = j$.createSpy(TestClass.prototype, TestClass.prototype.someFunction); + var spy = jasmineUnderTest.createSpy(TestClass.prototype, TestClass.prototype.someFunction); var trackSpy = spyOn(spy.calls, "track"); spy.and.returnValue("return value"); @@ -61,7 +61,7 @@ describe('Spies', function () { describe("createSpyObj", function() { it("should create an object with a bunch of spy methods when you call jasmine.createSpyObj()", function() { - var spyObj = j$.createSpyObj('BaseName', ['method1', 'method2']); + var spyObj = jasmineUnderTest.createSpyObj('BaseName', ['method1', 'method2']); expect(spyObj).toEqual({ method1: jasmine.any(Function), method2: jasmine.any(Function)}); expect(spyObj.method1.and.identity()).toEqual('BaseName.method1'); @@ -69,7 +69,7 @@ describe('Spies', function () { }); it("should allow you to omit the baseName", function() { - var spyObj = j$.createSpyObj(['method1', 'method2']); + var spyObj = jasmineUnderTest.createSpyObj(['method1', 'method2']); expect(spyObj).toEqual({ method1: jasmine.any(Function), method2: jasmine.any(Function)}); expect(spyObj.method1.and.identity()).toEqual('unknown.method1'); @@ -78,7 +78,7 @@ describe('Spies', function () { it("should throw if you do not pass an array argument", function() { expect(function() { - j$.createSpyObj('BaseName'); + jasmineUnderTest.createSpyObj('BaseName'); }).toThrow("createSpyObj requires a non-empty array of method names to create spies for"); }); }); diff --git a/spec/core/SpyStrategySpec.js b/spec/core/SpyStrategySpec.js index 2c9d7f14..d613188d 100644 --- a/spec/core/SpyStrategySpec.js +++ b/spec/core/SpyStrategySpec.js @@ -1,20 +1,20 @@ describe("SpyStrategy", function() { it("defaults its name to unknown", function() { - var spyStrategy = new j$.SpyStrategy(); + var spyStrategy = new jasmineUnderTest.SpyStrategy(); expect(spyStrategy.identity()).toEqual("unknown"); }); it("takes a name", function() { - var spyStrategy = new j$.SpyStrategy({name: "foo"}); + var spyStrategy = new jasmineUnderTest.SpyStrategy({name: "foo"}); expect(spyStrategy.identity()).toEqual("foo"); }); it("stubs an original function, if provided", function() { var originalFn = jasmine.createSpy("original"), - spyStrategy = new j$.SpyStrategy({fn: originalFn}); + spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn}); spyStrategy.exec(); @@ -23,7 +23,7 @@ describe("SpyStrategy", function() { it("allows an original function to be called, passed through the params and returns it's value", function() { var originalFn = jasmine.createSpy("original").and.returnValue(42), - spyStrategy = new j$.SpyStrategy({fn: originalFn}), + spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn}), returnValue; spyStrategy.callThrough(); @@ -36,7 +36,7 @@ describe("SpyStrategy", function() { it("can return a specified value when executed", function() { var originalFn = jasmine.createSpy("original"), - spyStrategy = new j$.SpyStrategy({fn: originalFn}), + spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn}), returnValue; spyStrategy.returnValue(17); @@ -48,7 +48,7 @@ describe("SpyStrategy", function() { it("can return specified values in order specified when executed", function() { var originalFn = jasmine.createSpy("original"), - spyStrategy = new j$.SpyStrategy({fn: originalFn}); + spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn}); spyStrategy.returnValues('value1', 'value2', 'value3'); @@ -61,7 +61,7 @@ describe("SpyStrategy", function() { it("allows an exception to be thrown when executed", function() { var originalFn = jasmine.createSpy("original"), - spyStrategy = new j$.SpyStrategy({fn: originalFn}); + spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn}); spyStrategy.throwError(new TypeError("bar")); @@ -71,7 +71,7 @@ describe("SpyStrategy", function() { it("allows a non-Error to be thrown, wrapping it into an exception when executed", function() { var originalFn = jasmine.createSpy("original"), - spyStrategy = new j$.SpyStrategy({fn: originalFn}); + spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn}); spyStrategy.throwError("bar"); @@ -82,7 +82,7 @@ describe("SpyStrategy", function() { it("allows a fake function to be called instead", function() { var originalFn = jasmine.createSpy("original"), fakeFn = jasmine.createSpy("fake").and.returnValue(67), - spyStrategy = new j$.SpyStrategy({fn: originalFn}), + spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn}), returnValue; spyStrategy.callFake(fakeFn); @@ -95,7 +95,7 @@ describe("SpyStrategy", function() { it("allows a return to plan stubbing after another strategy", function() { var originalFn = jasmine.createSpy("original"), fakeFn = jasmine.createSpy("fake").and.returnValue(67), - spyStrategy = new j$.SpyStrategy({fn: originalFn}), + spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn}), returnValue; spyStrategy.callFake(fakeFn); @@ -113,7 +113,7 @@ describe("SpyStrategy", function() { it("returns the spy after changing the strategy", function(){ var spy = {}, spyFn = jasmine.createSpy('spyFn').and.returnValue(spy), - spyStrategy = new j$.SpyStrategy({getSpy: spyFn}); + spyStrategy = new jasmineUnderTest.SpyStrategy({getSpy: spyFn}); expect(spyStrategy.callThrough()).toBe(spy); expect(spyStrategy.returnValue()).toBe(spy); diff --git a/spec/core/SuiteSpec.js b/spec/core/SuiteSpec.js index c36d1d68..b376dafd 100644 --- a/spec/core/SuiteSpec.js +++ b/spec/core/SuiteSpec.js @@ -1,8 +1,8 @@ describe("Suite", function() { it("keeps its id", function() { - var env = new j$.Env(), - suite = new j$.Suite({ + var env = new jasmineUnderTest.Env(), + suite = new jasmineUnderTest.Suite({ env: env, id: 456, description: "I am a suite" @@ -12,8 +12,8 @@ describe("Suite", function() { }); it("returns its full name", function() { - var env = new j$.Env(), - suite = new j$.Suite({ + var env = new jasmineUnderTest.Env(), + suite = new jasmineUnderTest.Suite({ env: env, description: "I am a suite" }); @@ -22,13 +22,13 @@ describe("Suite", function() { }); it("returns its full name when it has parent suites", function() { - var env = new j$.Env(), - parentSuite = new j$.Suite({ + var env = new jasmineUnderTest.Env(), + parentSuite = new jasmineUnderTest.Suite({ env: env, description: "I am a parent suite", parentSuite: jasmine.createSpy('pretend top level suite') }), - suite = new j$.Suite({ + suite = new jasmineUnderTest.Suite({ env: env, description: "I am a suite", parentSuite: parentSuite @@ -38,8 +38,8 @@ describe("Suite", function() { }); it("adds before functions in order of needed execution", function() { - var env = new j$.Env(), - suite = new j$.Suite({ + var env = new jasmineUnderTest.Env(), + suite = new jasmineUnderTest.Suite({ env: env, description: "I am a suite" }), @@ -53,8 +53,8 @@ describe("Suite", function() { }); it("adds after functions in order of needed execution", function() { - var env = new j$.Env(), - suite = new j$.Suite({ + var env = new jasmineUnderTest.Env(), + suite = new jasmineUnderTest.Suite({ env: env, description: "I am a suite" }), @@ -68,7 +68,7 @@ describe("Suite", function() { }); it('has a status of failed if any afterAll expectations have failed', function() { - var suite = new j$.Suite({ + var suite = new jasmineUnderTest.Suite({ expectationResultFactory: function() { return 'hi'; } }); suite.addChild({ result: { status: 'done' } }); @@ -78,27 +78,27 @@ describe("Suite", function() { }); it("retrieves a result with updated status", function() { - var suite = new j$.Suite({}); + var suite = new jasmineUnderTest.Suite({}); expect(suite.getResult().status).toBe('finished'); }); it("retrieves a result with disabled status", function() { - var suite = new j$.Suite({}); + var suite = new jasmineUnderTest.Suite({}); suite.disable(); expect(suite.getResult().status).toBe('disabled'); }); it("retrieves a result with pending status", function() { - var suite = new j$.Suite({}); + var suite = new jasmineUnderTest.Suite({}); suite.pend(); expect(suite.getResult().status).toBe('pending'); }); it("priviledges a disabled status over pending status", function() { - var suite = new j$.Suite({}); + var suite = new jasmineUnderTest.Suite({}); suite.disable(); suite.pend(); @@ -106,20 +106,20 @@ describe("Suite", function() { }); it("is executable if not disabled", function() { - var suite = new j$.Suite({}); + var suite = new jasmineUnderTest.Suite({}); expect(suite.isExecutable()).toBe(true); }); it("is not executable if disabled", function() { - var suite = new j$.Suite({}); + var suite = new jasmineUnderTest.Suite({}); suite.disable(); expect(suite.isExecutable()).toBe(false); }); it("tells all children about expectation failures, even if one throws", function() { - var suite = new j$.Suite({}), + var suite = new jasmineUnderTest.Suite({}), child1 = { addExpectationResult: jasmine.createSpy('child1#expectationResult'), result: {} }, child2 = { addExpectationResult: jasmine.createSpy('child2#expectationResult'), result: {} }; @@ -135,7 +135,7 @@ describe("Suite", function() { }); it("throws an ExpectationFailed when receiving a failed expectation in an afterAll when throwOnExpectationFailure is set", function() { - var suite = new j$.Suite({ + var suite = new jasmineUnderTest.Suite({ expectationResultFactory: function(data) { return data; }, throwOnExpectationFailure: true }); @@ -143,17 +143,17 @@ describe("Suite", function() { expect(function() { suite.addExpectationResult(false, 'failed'); - }).toThrowError(j$.errors.ExpectationFailed); + }).toThrowError(jasmineUnderTest.errors.ExpectationFailed); expect(suite.status()).toBe('failed'); expect(suite.result.failedExpectations).toEqual(['failed']); }); it("does not add an additional failure when an expectation fails in an afterAll", function(){ - var suite = new j$.Suite({}); + var suite = new jasmineUnderTest.Suite({}); suite.addChild({ result: { status: 'done' } }); - suite.onException(new j$.errors.ExpectationFailed()); + suite.onException(new jasmineUnderTest.errors.ExpectationFailed()); expect(suite.getResult().failedExpectations).toEqual([]); }) diff --git a/spec/core/TimerSpec.js b/spec/core/TimerSpec.js index 41e28148..96d8352a 100644 --- a/spec/core/TimerSpec.js +++ b/spec/core/TimerSpec.js @@ -1,7 +1,7 @@ describe("Timer", function() { it("reports the time elapsed", function() { var fakeNow = jasmine.createSpy('fake Date.now'), - timer = new j$.Timer({now: fakeNow}); + timer = new jasmineUnderTest.Timer({now: fakeNow}); fakeNow.and.returnValue(100); timer.start(); @@ -22,7 +22,7 @@ describe("Timer", function() { }); it("does not throw even though Date was taken away", function() { - var timer = new j$.Timer(); + var timer = new jasmineUnderTest.Timer(); expect(timer.start).not.toThrow(); expect(timer.elapsed()).toEqual(jasmine.any(Number)); diff --git a/spec/core/TreeProcessorSpec.js b/spec/core/TreeProcessorSpec.js index 3dea3ee8..d1f2cd9b 100644 --- a/spec/core/TreeProcessorSpec.js +++ b/spec/core/TreeProcessorSpec.js @@ -30,7 +30,7 @@ describe("TreeProcessor", function() { it("processes a single executable leaf", function() { var leaf = new Leaf(), - processor = new j$.TreeProcessor({ tree: leaf, runnableIds: [leaf.id] }), + processor = new jasmineUnderTest.TreeProcessor({ tree: leaf, runnableIds: [leaf.id] }), result = processor.processTree(); expect(result.valid).toBe(true); @@ -43,7 +43,7 @@ describe("TreeProcessor", function() { it("processes a single non-executable leaf", function() { var leaf = new Leaf({ executable: false }), - processor = new j$.TreeProcessor({ tree: leaf, runnableIds: [leaf.id] }), + processor = new jasmineUnderTest.TreeProcessor({ tree: leaf, runnableIds: [leaf.id] }), result = processor.processTree(); expect(result.valid).toBe(true); @@ -56,7 +56,7 @@ describe("TreeProcessor", function() { it("processes a single non-specified leaf", function() { var leaf = new Leaf(), - processor = new j$.TreeProcessor({ tree: leaf, runnableIds: [] }), + processor = new jasmineUnderTest.TreeProcessor({ tree: leaf, runnableIds: [] }), result = processor.processTree(); expect(result.valid).toBe(true); @@ -70,7 +70,7 @@ describe("TreeProcessor", function() { it("processes a tree with a single leaf with the root specified", function() { var leaf = new Leaf(), parent = new Node({ children: [leaf] }), - processor = new j$.TreeProcessor({ tree: parent, runnableIds: [parent.id] }), + processor = new jasmineUnderTest.TreeProcessor({ tree: parent, runnableIds: [parent.id] }), result = processor.processTree(); expect(result.valid).toBe(true); @@ -89,7 +89,7 @@ describe("TreeProcessor", function() { it("processes a tree with a single non-executable leaf, with the root specified", function() { var leaf = new Leaf({ executable: false }), parent = new Node({ children: [leaf] }), - processor = new j$.TreeProcessor({ tree: parent, runnableIds: [parent.id] }), + processor = new jasmineUnderTest.TreeProcessor({ tree: parent, runnableIds: [parent.id] }), result = processor.processTree(); expect(result.valid).toBe(true); @@ -113,7 +113,7 @@ describe("TreeProcessor", function() { childOfDisabled = new Leaf({ executable: true }), disabledNode = new Node({ executable: false, children: [childOfDisabled] }), root = new Node({ children: [parent, childless, disabledNode] }), - processor = new j$.TreeProcessor({ tree: root, runnableIds: [root.id] }), + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [root.id] }), result = processor.processTree(); expect(result.valid).toBe(true); @@ -160,7 +160,7 @@ describe("TreeProcessor", function() { leaf3 = new Leaf(), reentered = new Node({ noReenter: true, children: [leaf1, leaf2] }), root = new Node({ children: [reentered, leaf3] }), - processor = new j$.TreeProcessor({ tree: root, runnableIds: [leaf1.id, leaf3.id, leaf2.id] }), + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [leaf1.id, leaf3.id, leaf2.id] }), result = processor.processTree(); expect(result).toEqual({ valid: false }); @@ -172,7 +172,7 @@ describe("TreeProcessor", function() { leaf3 = new Leaf(), reentered = new Node({ children: [leaf1, leaf2] }), root = new Node({ children: [reentered, leaf3] }), - processor = new j$.TreeProcessor({ tree: root, runnableIds: [leaf1.id, leaf3.id, leaf2.id] }), + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [leaf1.id, leaf3.id, leaf2.id] }), result = processor.processTree(); expect(result.valid).toBe(true); @@ -184,7 +184,7 @@ describe("TreeProcessor", function() { leaf3 = new Leaf(), noReentry = new Node({ noReenter: true }), root = new Node({ children: [noReentry] }), - processor = new j$.TreeProcessor({ tree: root, runnableIds: [leaf2.id, leaf1.id, leaf3.id] }), + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [leaf2.id, leaf1.id, leaf3.id] }), result = processor.processTree(); expect(result.valid).toBe(true); @@ -194,7 +194,7 @@ describe("TreeProcessor", function() { var leaf1 = new Leaf(), noReentry = new Node({ noReenter: true }), root = new Node({ children: [noReentry] }), - processor = new j$.TreeProcessor({ tree: root, runnableIds: [root.id] }), + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [root.id] }), result = processor.processTree(); expect(result.valid).toBe(true); @@ -204,7 +204,7 @@ describe("TreeProcessor", function() { var leaf = new Leaf(), node = new Node({ children: [leaf], userContext: { root: 'context' } }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ tree: node, runnableIds: [leaf.id], queueRunnerFactory: queueRunner }), + processor = new jasmineUnderTest.TreeProcessor({ tree: node, runnableIds: [leaf.id], queueRunnerFactory: queueRunner }), treeComplete = jasmine.createSpy('treeComplete'); processor.execute(treeComplete); @@ -227,7 +227,7 @@ describe("TreeProcessor", function() { nodeStart = jasmine.createSpy('nodeStart'), nodeComplete = jasmine.createSpy('nodeComplete'), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [node.id], nodeStart: nodeStart, @@ -269,7 +269,7 @@ describe("TreeProcessor", function() { node = new Node({ children: [leaf1, leaf2] }), root = new Node({ children: [node] }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [node.id], queueRunnerFactory: queueRunner @@ -298,7 +298,7 @@ describe("TreeProcessor", function() { queueRunner = jasmine.createSpy('queueRunner'), nodeStart = jasmine.createSpy('nodeStart'), nodeComplete = jasmine.createSpy('nodeComplete'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [node.id], queueRunnerFactory: queueRunner, @@ -334,7 +334,7 @@ describe("TreeProcessor", function() { }), root = new Node({ children: [node] }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [node.id], queueRunnerFactory: queueRunner @@ -359,7 +359,7 @@ describe("TreeProcessor", function() { }), root = new Node({ children: [node] }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [node.id], queueRunnerFactory: queueRunner @@ -383,7 +383,7 @@ describe("TreeProcessor", function() { }), root = new Node({ children: [node] }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [node.id], queueRunnerFactory: queueRunner @@ -410,7 +410,7 @@ describe("TreeProcessor", function() { }), root = new Node({ children: [node] }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [node.id], queueRunnerFactory: queueRunner @@ -432,7 +432,7 @@ describe("TreeProcessor", function() { leaf2 = new Leaf(), root = new Node({ children: [leaf1, leaf2] }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [leaf2.id, leaf1.id], queueRunnerFactory: queueRunner @@ -456,7 +456,7 @@ describe("TreeProcessor", function() { nonSpecified = new Leaf(), root = new Node({ children: [nonSpecified, specified] }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [specified.id], queueRunnerFactory: queueRunner @@ -481,7 +481,7 @@ describe("TreeProcessor", function() { specifiedNode = new Node({ children: [childLeaf] }), root = new Node({ children: [specifiedLeaf, specifiedNode] }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [specifiedNode.id, specifiedLeaf.id], queueRunnerFactory: queueRunner @@ -511,7 +511,7 @@ describe("TreeProcessor", function() { reentered = new Node({ children: [leaf1, leaf2, leaf3] }), root = new Node({ children: [reentered, leaf4, leaf5] }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [leaf1.id, leaf4.id, leaf2.id, leaf5.id, leaf3.id], queueRunnerFactory: queueRunner @@ -555,7 +555,7 @@ describe("TreeProcessor", function() { grandparent = new Node({ children: [parent] }), root = new Node({ children: [grandparent, leaf4, leaf5] }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [leaf1.id, leaf4.id, leaf2.id, leaf5.id, leaf3.id], queueRunnerFactory: queueRunner @@ -609,7 +609,7 @@ describe("TreeProcessor", function() { parent = new Node({ children: [leaf2, leaf3] }), root = new Node({ children: [leaf1, parent] }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [root.id], queueRunnerFactory: queueRunner @@ -647,7 +647,7 @@ describe("TreeProcessor", function() { leaf11 = new Leaf(), root = new Node({ children: [leaf1, leaf2, leaf3, leaf4, leaf5, leaf6, leaf7, leaf8, leaf9, leaf10, leaf11] }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [root.id], queueRunnerFactory: queueRunner @@ -705,7 +705,7 @@ describe("TreeProcessor", function() { leaf11 = new Leaf(), root = new Node({ children: [leaf1, leaf2, leaf3, leaf4, leaf5, leaf6, leaf7, leaf8, leaf9, leaf10, leaf11] }), queueRunner = jasmine.createSpy('queueRunner'), - processor = new j$.TreeProcessor({ + processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [root.id], queueRunnerFactory: queueRunner, diff --git a/spec/core/UtilSpec.js b/spec/core/UtilSpec.js index cddcc8d0..f33fb67e 100644 --- a/spec/core/UtilSpec.js +++ b/spec/core/UtilSpec.js @@ -1,28 +1,28 @@ -describe("j$.util", function() { +describe("jasmineUnderTest.util", function() { describe("isArray_", function() { it("should return true if the argument is an array", function() { - expect(j$.isArray_([])).toBe(true); - expect(j$.isArray_(['a'])).toBe(true); + expect(jasmineUnderTest.isArray_([])).toBe(true); + expect(jasmineUnderTest.isArray_(['a'])).toBe(true); }); it("should return false if the argument is not an array", function() { - expect(j$.isArray_(undefined)).toBe(false); - expect(j$.isArray_({})).toBe(false); - expect(j$.isArray_(function() {})).toBe(false); - expect(j$.isArray_('foo')).toBe(false); - expect(j$.isArray_(5)).toBe(false); - expect(j$.isArray_(null)).toBe(false); + expect(jasmineUnderTest.isArray_(undefined)).toBe(false); + expect(jasmineUnderTest.isArray_({})).toBe(false); + expect(jasmineUnderTest.isArray_(function() {})).toBe(false); + expect(jasmineUnderTest.isArray_('foo')).toBe(false); + expect(jasmineUnderTest.isArray_(5)).toBe(false); + expect(jasmineUnderTest.isArray_(null)).toBe(false); }); }); describe("isUndefined", function() { it("reports if a variable is defined", function() { var a; - expect(j$.util.isUndefined(a)).toBe(true); - expect(j$.util.isUndefined(undefined)).toBe(true); + expect(jasmineUnderTest.util.isUndefined(a)).toBe(true); + expect(jasmineUnderTest.util.isUndefined(undefined)).toBe(true); var undefined = "diz be undefined yo"; - expect(j$.util.isUndefined(undefined)).toBe(false); + expect(jasmineUnderTest.util.isUndefined(undefined)).toBe(false); }); }); }); diff --git a/spec/core/asymmetric_equality/AnySpec.js b/spec/core/asymmetric_equality/AnySpec.js index c490741a..28c433bf 100644 --- a/spec/core/asymmetric_equality/AnySpec.js +++ b/spec/core/asymmetric_equality/AnySpec.js @@ -1,43 +1,43 @@ describe("Any", function() { it("matches a string", function() { - var any = new j$.Any(String); + var any = new jasmineUnderTest.Any(String); expect(any.asymmetricMatch("foo")).toBe(true); }); it("matches a number", function() { - var any = new j$.Any(Number); + var any = new jasmineUnderTest.Any(Number); expect(any.asymmetricMatch(1)).toBe(true); }); it("matches a function", function() { - var any = new j$.Any(Function); + var any = new jasmineUnderTest.Any(Function); expect(any.asymmetricMatch(function(){})).toBe(true); }); it("matches an Object", function() { - var any = new j$.Any(Object); + var any = new jasmineUnderTest.Any(Object); expect(any.asymmetricMatch({})).toBe(true); }); it("matches a Boolean", function() { - var any = new j$.Any(Boolean); + var any = new jasmineUnderTest.Any(Boolean); expect(any.asymmetricMatch(true)).toBe(true); }); it("matches another constructed object", function() { var Thing = function() {}, - any = new j$.Any(Thing); + any = new jasmineUnderTest.Any(Thing); expect(any.asymmetricMatch(new Thing())).toBe(true); }); it("jasmineToString's itself", function() { - var any = new j$.Any(Number); + var any = new jasmineUnderTest.Any(Number); expect(any.jasmineToString()).toEqual(''); }); @@ -45,7 +45,7 @@ describe("Any", function() { describe("when called without an argument", function() { it("tells the user to pass a constructor or use jasmine.anything()", function() { expect(function() { - new j$.Any(); + new jasmineUnderTest.Any(); }).toThrowError(TypeError, /constructor.*anything/); }); }); diff --git a/spec/core/asymmetric_equality/AnythingSpec.js b/spec/core/asymmetric_equality/AnythingSpec.js index b3a6ea74..8ee1f4e5 100644 --- a/spec/core/asymmetric_equality/AnythingSpec.js +++ b/spec/core/asymmetric_equality/AnythingSpec.js @@ -1,43 +1,43 @@ describe("Anything", function() { it("matches a string", function() { - var anything = new j$.Anything(); + var anything = new jasmineUnderTest.Anything(); expect(anything.asymmetricMatch('foo')).toBe(true); }); it("matches a number", function() { - var anything = new j$.Anything(); + var anything = new jasmineUnderTest.Anything(); expect(anything.asymmetricMatch(42)).toBe(true); }); it("matches an object", function() { - var anything = new j$.Anything(); + var anything = new jasmineUnderTest.Anything(); expect(anything.asymmetricMatch({ foo: 'bar' })).toBe(true); }); it("matches an array", function() { - var anything = new j$.Anything(); + var anything = new jasmineUnderTest.Anything(); expect(anything.asymmetricMatch([1,2,3])).toBe(true); }); it("doesn't match undefined", function() { - var anything = new j$.Anything(); + var anything = new jasmineUnderTest.Anything(); expect(anything.asymmetricMatch()).toBe(false); expect(anything.asymmetricMatch(undefined)).toBe(false); }); it("doesn't match null", function() { - var anything = new j$.Anything(); + var anything = new jasmineUnderTest.Anything(); expect(anything.asymmetricMatch(null)).toBe(false); }); it("jasmineToString's itself", function() { - var anything = new j$.Anything(); + var anything = new jasmineUnderTest.Anything(); expect(anything.jasmineToString()).toEqual(""); }); diff --git a/spec/core/asymmetric_equality/ArrayContainingSpec.js b/spec/core/asymmetric_equality/ArrayContainingSpec.js index a508ea94..999a6bf8 100644 --- a/spec/core/asymmetric_equality/ArrayContainingSpec.js +++ b/spec/core/asymmetric_equality/ArrayContainingSpec.js @@ -1,12 +1,12 @@ describe("ArrayContaining", function() { it("matches any actual to an empty array", function() { - var containing = new j$.ArrayContaining([]); + var containing = new jasmineUnderTest.ArrayContaining([]); expect(containing.asymmetricMatch("foo")).toBe(true); }); it("does not work when not passed an array", function() { - var containing = new j$.ArrayContaining("foo"); + var containing = new jasmineUnderTest.ArrayContaining("foo"); expect(function() { containing.asymmetricMatch([]); @@ -14,25 +14,25 @@ describe("ArrayContaining", function() { }); it("matches when the item is in the actual", function() { - var containing = new j$.ArrayContaining(["foo"]); + var containing = new jasmineUnderTest.ArrayContaining(["foo"]); expect(containing.asymmetricMatch(["foo"])).toBe(true); }); it("matches when additional items are in the actual", function() { - var containing = new j$.ArrayContaining(["foo"]); + var containing = new jasmineUnderTest.ArrayContaining(["foo"]); expect(containing.asymmetricMatch(["foo", "bar"])).toBe(true); }); it("does not match when the item is not in the actual", function() { - var containing = new j$.ArrayContaining(["foo"]); + var containing = new jasmineUnderTest.ArrayContaining(["foo"]); expect(containing.asymmetricMatch(["bar"])).toBe(false); }); it("jasmineToStrings itself", function() { - var containing = new j$.ArrayContaining([]); + var containing = new jasmineUnderTest.ArrayContaining([]); expect(containing.jasmineToString()).toMatch(""); }); diff --git a/spec/core/integration/CustomMatchersSpec.js b/spec/core/integration/CustomMatchersSpec.js index 6c03d3d5..3d9cd457 100644 --- a/spec/core/integration/CustomMatchersSpec.js +++ b/spec/core/integration/CustomMatchersSpec.js @@ -3,7 +3,7 @@ describe("Custom Matchers (Integration)", function() { var fakeTimer; beforeEach(function() { - env = new j$.Env(); + env = new jasmineUnderTest.Env(); }); it("allows adding more matchers local to a spec", function(done) { @@ -142,7 +142,7 @@ describe("Custom Matchers (Integration)", function() { }); var specExpectations = function() { - expect(argumentSpy).toHaveBeenCalledWith(j$.matchersUtil, [customEqualityFn]); + expect(argumentSpy).toHaveBeenCalledWith(jasmineUnderTest.matchersUtil, [customEqualityFn]); }; env.addReporter({ specDone: specExpectations, jasmineDone: done }); diff --git a/spec/core/integration/EnvSpec.js b/spec/core/integration/EnvSpec.js index 08c13be4..4ea60413 100644 --- a/spec/core/integration/EnvSpec.js +++ b/spec/core/integration/EnvSpec.js @@ -41,7 +41,7 @@ describe("Env integration", function() { }); it("Suites execute as expected (no nesting)", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), calls = []; var assertions = function() { @@ -68,7 +68,7 @@ describe("Env integration", function() { }); it("Nested Suites execute as expected", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), calls = []; var assertions = function() { @@ -101,7 +101,7 @@ describe("Env integration", function() { }); it("Multiple top-level Suites execute as expected", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), calls = []; var assertions = function() { @@ -142,7 +142,7 @@ describe("Env integration", function() { }); it('explicitly fails a spec', function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), specDone = jasmine.createSpy('specDone'); env.addReporter({ @@ -204,7 +204,7 @@ describe("Env integration", function() { it("calls associated befores/specs/afters with the same 'this'", function(done) { - var env = new j$.Env(); + var env = new jasmineUnderTest.Env(); env.addReporter({jasmineDone: done}); env.describe("tests", function() { @@ -241,7 +241,7 @@ describe("Env integration", function() { }); it("calls associated befores/its/afters with the same 'this' for an async spec", function(done) { - var env = new j$.Env(); + var env = new jasmineUnderTest.Env(); env.addReporter({jasmineDone: done}); @@ -267,7 +267,7 @@ describe("Env integration", function() { }); it("calls associated beforeAlls/afterAlls only once per suite", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), before = jasmine.createSpy('beforeAll'), after = jasmine.createSpy('afterAll'); @@ -299,7 +299,7 @@ describe("Env integration", function() { }); it("calls associated beforeAlls/afterAlls only once per suite for async", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), before = jasmine.createSpy('beforeAll'), after = jasmine.createSpy('afterAll'); @@ -338,7 +338,7 @@ describe("Env integration", function() { }); it("calls associated beforeAlls/afterAlls with the cascaded 'this'", function(done) { - var env = new j$.Env(); + var env = new jasmineUnderTest.Env(); env.addReporter({jasmineDone: done}); @@ -392,7 +392,7 @@ describe("Env integration", function() { }); it("fails all underlying specs when the beforeAll fails", function (done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReporter', [ "specDone", "jasmineDone" ]); reporter.jasmineDone.and.callFake(function() { @@ -431,7 +431,7 @@ describe("Env integration", function() { describe('suiteDone reporting', function(){ it("reports when an afterAll fails an expectation", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']); reporter.jasmineDone.and.callFake(function() { @@ -458,7 +458,7 @@ describe("Env integration", function() { }); it("if there are no specs, it still reports correctly", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']); reporter.jasmineDone.and.callFake(function() { @@ -486,7 +486,7 @@ describe("Env integration", function() { }); it("reports when afterAll throws an exception", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), error = new Error('After All Exception'), reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']); @@ -512,7 +512,7 @@ describe("Env integration", function() { }); it("reports when an async afterAll fails an expectation", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']); reporter.jasmineDone.and.callFake(function() { @@ -538,7 +538,7 @@ describe("Env integration", function() { }); it("reports when an async afterAll throws an exception", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), error = new Error('After All Exception'), reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']); @@ -566,7 +566,7 @@ describe("Env integration", function() { }); it("Allows specifying which specs and suites to run", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), calls = [], suiteCallback = jasmine.createSpy('suite callback'), firstSpec, @@ -602,7 +602,7 @@ describe("Env integration", function() { }); it('runs before and after all functions for runnables provided to .execute()', function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), calls = [], first_spec, second_spec; @@ -638,7 +638,7 @@ describe("Env integration", function() { }); it("Functions can be spied on and have their calls tracked", function (done) { - var env = new j$.Env(); + var env = new jasmineUnderTest.Env(); var originalFunctionWasCalled = false; var subject = { @@ -678,7 +678,7 @@ describe("Env integration", function() { }); it('removes all spies added in a spec after the spec is complete', function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), originalFoo = function() {}, testObj = { foo: originalFoo @@ -706,7 +706,7 @@ describe("Env integration", function() { }); it('removes all spies added in a suite after the suite is complete', function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), originalFoo = function() {}, testObj = { foo: originalFoo @@ -716,17 +716,17 @@ describe("Env integration", function() { env.beforeAll(function() { env.spyOn(testObj, 'foo');}) env.it('spec 0', function() { - expect(j$.isSpy(testObj.foo)).toBe(true); + expect(jasmineUnderTest.isSpy(testObj.foo)).toBe(true); }); env.it('spec 1', function() { - expect(j$.isSpy(testObj.foo)).toBe(true); + expect(jasmineUnderTest.isSpy(testObj.foo)).toBe(true); }); }); env.describe('another suite', function() { env.it('spec 2', function() { - expect(j$.isSpy(testObj.foo)).toBe(false); + expect(jasmineUnderTest.isSpy(testObj.foo)).toBe(false); }); }); @@ -739,7 +739,7 @@ describe("Env integration", function() { var globalSetTimeout = jasmine.createSpy('globalSetTimeout'), delayedFunctionForGlobalClock = jasmine.createSpy('delayedFunctionForGlobalClock'), delayedFunctionForMockClock = jasmine.createSpy('delayedFunctionForMockClock'), - env = new j$.Env({global: { setTimeout: globalSetTimeout }}); + env = new jasmineUnderTest.Env({global: { setTimeout: globalSetTimeout }}); var assertions = function() { expect(delayedFunctionForMockClock).toHaveBeenCalled(); @@ -769,7 +769,7 @@ describe("Env integration", function() { }); it("should run async specs in order, waiting for them to complete", function(done) { - var env = new j$.Env(), mutatedVar; + var env = new jasmineUnderTest.Env(), mutatedVar; env.describe("tests", function() { env.beforeEach(function() { @@ -796,17 +796,17 @@ describe("Env integration", function() { var originalTimeout; beforeEach(function() { - originalTimeout = j$.DEFAULT_TIMEOUT_INTERVAL; + originalTimeout = jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL; jasmine.clock().install(); }); afterEach(function() { jasmine.clock().uninstall(); - j$.DEFAULT_TIMEOUT_INTERVAL = originalTimeout; + jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL = originalTimeout; }); it("should wait a specified interval before failing specs haven't called done yet", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReporter', [ "specDone", "jasmineDone" ]); reporter.specDone.and.callFake(function() { @@ -819,7 +819,7 @@ describe("Env integration", function() { }); env.addReporter(reporter); - j$.DEFAULT_TIMEOUT_INTERVAL = 8414; + jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL = 8414; env.it("async spec that doesn't call done", function(underTestCallback) { env.expect(true).toBeTruthy(); @@ -830,7 +830,7 @@ describe("Env integration", function() { }); it("should wait a specified interval before failing beforeAll's and their associated specs that haven't called done", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReporter', [ "specDone", "jasmineDone" ]); reporter.jasmineDone.and.callFake(function() { @@ -841,7 +841,7 @@ describe("Env integration", function() { }); env.addReporter(reporter); - j$.DEFAULT_TIMEOUT_INTERVAL = 1290; + jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL = 1290; env.beforeAll(function(done) { jasmine.clock().tick(1290); @@ -859,7 +859,7 @@ describe("Env integration", function() { }); it("should not use the mock clock for asynchronous timeouts", function(){ - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReporter', [ "specDone", "jasmineDone" ]), clock = env.clock; @@ -869,7 +869,7 @@ describe("Env integration", function() { }); env.addReporter(reporter); - j$.DEFAULT_TIMEOUT_INTERVAL = 5; + jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL = 5; env.beforeAll(function() { clock.install(); @@ -889,7 +889,7 @@ describe("Env integration", function() { }); it("should wait the specified interval before reporting an afterAll that fails to call done", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone','suiteDone']); reporter.jasmineDone.and.callFake(function() { @@ -900,7 +900,7 @@ describe("Env integration", function() { }); env.addReporter(reporter); - j$.DEFAULT_TIMEOUT_INTERVAL = 3000; + jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL = 3000; env.describe('my suite', function() { env.it('my spec', function() { @@ -916,7 +916,7 @@ describe("Env integration", function() { }); it('should wait a custom interval before reporting async functions that fail to call done', function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReport', ['jasmineDone', 'suiteDone', 'specDone']); reporter.jasmineDone.and.callFake(function() { @@ -944,7 +944,7 @@ describe("Env integration", function() { }); env.addReporter(reporter); - j$.DEFAULT_TIMEOUT_INTERVAL = 10000; + jasmineUnderTest.DEFAULT_TIMEOUT_INTERVAL = 10000; env.describe('suite', function() { env.describe('beforeAll', function() { @@ -993,7 +993,7 @@ describe("Env integration", function() { }); it('explicitly fails an async spec', function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), specDone = jasmine.createSpy('specDone'); env.addReporter({ @@ -1066,7 +1066,7 @@ describe("Env integration", function() { describe('focused tests', function() { it('should only run the focused tests', function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), calls = []; var assertions = function() { @@ -1090,7 +1090,7 @@ describe("Env integration", function() { }); it('should only run focused suites', function(){ - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), calls = []; var assertions = function() { @@ -1116,7 +1116,7 @@ describe("Env integration", function() { }); it('should run focused tests inside an xdescribe', function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReporter', [ "jasmineStarted", "jasmineDone", @@ -1151,7 +1151,7 @@ describe("Env integration", function() { }); it('should run focused suites inside an xdescribe', function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReporter', [ "jasmineStarted", "jasmineDone", @@ -1189,7 +1189,7 @@ describe("Env integration", function() { }); it("should report as expected", function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReporter', [ "jasmineStarted", "jasmineDone", @@ -1259,7 +1259,7 @@ describe("Env integration", function() { }); it('should report pending spec messages', function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReporter', [ 'specDone', 'jasmineDone' @@ -1283,7 +1283,7 @@ describe("Env integration", function() { }); it('should report xdescribes as expected', function(done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), reporter = jasmine.createSpyObj('fakeReporter', [ "jasmineStarted", "jasmineDone", @@ -1301,7 +1301,7 @@ describe("Env integration", function() { expect(reporter.specDone).toHaveBeenCalledWith(jasmine.objectContaining({ status: 'pending' })); expect(reporter.suiteDone).toHaveBeenCalledWith(jasmine.objectContaining({ description: 'xd out', status: 'pending' })); expect(reporter.suiteDone.calls.count()).toBe(4); - + done(); }); @@ -1323,7 +1323,7 @@ describe("Env integration", function() { }); it("should be possible to get full name from a spec", function() { - var env = new j$.Env({global: { setTimeout: setTimeout }}), + var env = new jasmineUnderTest.Env({global: { setTimeout: setTimeout }}), topLevelSpec, nestedSpec, doublyNestedSpec; env.describe("my tests", function() { @@ -1345,7 +1345,7 @@ describe("Env integration", function() { }); it("Custom equality testers should be per spec", function(done) { - var env = new j$.Env({global: { setTimeout: setTimeout }}), + var env = new jasmineUnderTest.Env({global: { setTimeout: setTimeout }}), reporter = jasmine.createSpyObj('fakeReporter', [ "jasmineDone", "specDone" @@ -1378,7 +1378,7 @@ describe("Env integration", function() { }); it("Custom equality testers should be per suite", function(done) { - var env = new j$.Env({global: { setTimeout: setTimeout }}), + var env = new jasmineUnderTest.Env({global: { setTimeout: setTimeout }}), reporter = jasmine.createSpyObj('fakeReporter', [ "jasmineDone", "specDone" @@ -1420,7 +1420,7 @@ describe("Env integration", function() { }); it("Custom equality testers for toContain should be per spec", function(done) { - var env = new j$.Env({global: { setTimeout: setTimeout }}), + var env = new jasmineUnderTest.Env({global: { setTimeout: setTimeout }}), reporter = jasmine.createSpyObj('fakeReporter', [ "jasmineDone", "specDone" @@ -1453,7 +1453,7 @@ describe("Env integration", function() { }); it("produces an understandable error message when an 'expect' is used outside of a current spec", function(done) { - var env = new j$.Env(); + var env = new jasmineUnderTest.Env(); env.describe("A Suite", function() { env.it("an async spec that is actually synchronous", function(underTestCallback) { @@ -1467,7 +1467,7 @@ describe("Env integration", function() { }); it("Custom equality testers for toContain should be per suite", function(done) { - var env = new j$.Env({global: { setTimeout: setTimeout }}), + var env = new jasmineUnderTest.Env({global: { setTimeout: setTimeout }}), reporter = jasmine.createSpyObj('fakeReporter', [ "jasmineDone", "specDone" @@ -1509,7 +1509,7 @@ describe("Env integration", function() { }); it("Custom matchers should be per spec", function(done) { - var env = new j$.Env({global: { setTimeout: setTimeout }}), + var env = new jasmineUnderTest.Env({global: { setTimeout: setTimeout }}), matchers = { toFoo: function() {} }; @@ -1531,7 +1531,7 @@ describe("Env integration", function() { }); it("Custom matchers should be per suite", function(done) { - var env = new j$.Env({global: { setTimeout: setTimeout }}), + var env = new jasmineUnderTest.Env({global: { setTimeout: setTimeout }}), matchers = { toFoo: function() {} }; @@ -1560,7 +1560,7 @@ describe("Env integration", function() { }); it('throws an exception if you try to create a spy outside of a runnable', function (done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), obj = {fn: function () {}}, exception; @@ -1583,7 +1583,7 @@ describe("Env integration", function() { }); it('throws an exception if you try to add a matcher outside of a runnable', function (done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), obj = {fn: function () {}}, exception; @@ -1606,7 +1606,7 @@ describe("Env integration", function() { }); it('throws an exception if you try to add a custom equality outside of a runnable', function (done) { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), obj = {fn: function () {}}, exception; diff --git a/spec/core/integration/SpecRunningSpec.js b/spec/core/integration/SpecRunningSpec.js index b79b207a..eeabae9a 100644 --- a/spec/core/integration/SpecRunningSpec.js +++ b/spec/core/integration/SpecRunningSpec.js @@ -2,7 +2,7 @@ describe("jasmine spec running", function () { var env; beforeEach(function() { - env = new j$.Env(); + env = new jasmineUnderTest.Env(); }); it('should assign spec ids sequentially', function() { @@ -559,7 +559,7 @@ describe("jasmine spec running", function () { // TODO: is this useful? It doesn't catch syntax errors xit("should recover gracefully when there are errors in describe functions", function() { var specs = []; - var superSimpleReporter = new j$.Reporter(); + var superSimpleReporter = new jasmineUnderTest.Reporter(); superSimpleReporter.reportSpecResults = function(result) { specs.push("Spec: " + result.fullName); }; diff --git a/spec/core/matchers/matchersUtilSpec.js b/spec/core/matchers/matchersUtilSpec.js index 26f8ff61..1ad5b210 100644 --- a/spec/core/matchers/matchersUtilSpec.js +++ b/spec/core/matchers/matchersUtilSpec.js @@ -1,61 +1,61 @@ describe("matchersUtil", function() { describe("equals", function() { it("passes for literals that are triple-equal", function() { - expect(j$.matchersUtil.equals(null, null)).toBe(true); - expect(j$.matchersUtil.equals(void 0, void 0)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(null, null)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(void 0, void 0)).toBe(true); }); it("fails for things that are not equivalent", function() { - expect(j$.matchersUtil.equals({a: "foo"}, 1)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals({a: "foo"}, 1)).toBe(false); }); it("passes for Strings that are equivalent", function() { - expect(j$.matchersUtil.equals("foo", "foo")).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals("foo", "foo")).toBe(true); }); it("fails for Strings that are not equivalent", function() { - expect(j$.matchersUtil.equals("foo", "bar")).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals("foo", "bar")).toBe(false); }); it("passes for Numbers that are equivalent", function() { - expect(j$.matchersUtil.equals(123, 123)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(123, 123)).toBe(true); }); it("fails for Numbers that are not equivalent", function() { - expect(j$.matchersUtil.equals(123, 456)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(123, 456)).toBe(false); }); it("passes for Dates that are equivalent", function() { - expect(j$.matchersUtil.equals(new Date("Jan 1, 1970"), new Date("Jan 1, 1970"))).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(new Date("Jan 1, 1970"), new Date("Jan 1, 1970"))).toBe(true); }); it("fails for Dates that are not equivalent", function() { - expect(j$.matchersUtil.equals(new Date("Jan 1, 1970"), new Date("Feb 3, 1991"))).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(new Date("Jan 1, 1970"), new Date("Feb 3, 1991"))).toBe(false); }); it("passes for Booleans that are equivalent", function() { - expect(j$.matchersUtil.equals(true, true)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(true, true)).toBe(true); }); it("fails for Booleans that are not equivalent", function() { - expect(j$.matchersUtil.equals(true, false)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(true, false)).toBe(false); }); it("passes for RegExps that are equivalent", function() { - expect(j$.matchersUtil.equals(/foo/, /foo/)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(/foo/, /foo/)).toBe(true); }); it("fails for RegExps that are not equivalent", function() { - expect(j$.matchersUtil.equals(/foo/, /bar/)).toBe(false); - expect(j$.matchersUtil.equals(new RegExp("foo", "i"), new RegExp("foo"))).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(/foo/, /bar/)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(new RegExp("foo", "i"), new RegExp("foo"))).toBe(false); }); it("passes for Arrays that are equivalent", function() { - expect(j$.matchersUtil.equals([1, 2], [1, 2])).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals([1, 2], [1, 2])).toBe(true); }); it("fails for Arrays that are not equivalent", function() { - expect(j$.matchersUtil.equals([1, 2], [1, 2, 3])).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals([1, 2], [1, 2, 3])).toBe(false); }); it("fails for Arrays whose contents are equivalent, but have differing properties", function() { @@ -65,31 +65,31 @@ describe("matchersUtil", function() { one.foo = 'bar'; two.foo = 'baz'; - expect(j$.matchersUtil.equals(one, two)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(one, two)).toBe(false); }); it("passes for Errors that are the same type and have the same message", function() { - expect(j$.matchersUtil.equals(new Error("foo"), new Error("foo"))).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(new Error("foo"), new Error("foo"))).toBe(true); }); it("fails for Errors that are the same type and have different messages", function() { - expect(j$.matchersUtil.equals(new Error("foo"), new Error("bar"))).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(new Error("foo"), new Error("bar"))).toBe(false); }); it("passes for Objects that are equivalent (simple case)", function() { - expect(j$.matchersUtil.equals({a: "foo"}, {a: "foo"})).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals({a: "foo"}, {a: "foo"})).toBe(true); }); it("fails for Objects that are not equivalent (simple case)", function() { - expect(j$.matchersUtil.equals({a: "foo"}, {a: "bar"})).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals({a: "foo"}, {a: "bar"})).toBe(false); }); it("passes for Objects that are equivalent (deep case)", function() { - expect(j$.matchersUtil.equals({a: "foo", b: { c: "bar"}}, {a: "foo", b: { c: "bar"}})).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals({a: "foo", b: { c: "bar"}}, {a: "foo", b: { c: "bar"}})).toBe(true); }); it("fails for Objects that are not equivalent (deep case)", function() { - expect(j$.matchersUtil.equals({a: "foo", b: { c: "baz"}}, {a: "foo", b: { c: "bar"}})).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals({a: "foo", b: { c: "baz"}}, {a: "foo", b: { c: "bar"}})).toBe(false); }); it("passes for Objects that are equivalent (with cycles)", function() { @@ -99,7 +99,7 @@ describe("matchersUtil", function() { actual.b = actual; expected.b = actual; - expect(j$.matchersUtil.equals(actual, expected)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(actual, expected)).toBe(true); }); it("fails for Objects that are not equivalent (with cycles)", function() { @@ -109,15 +109,15 @@ describe("matchersUtil", function() { actual.b = actual; expected.b = actual; - expect(j$.matchersUtil.equals(actual, expected)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(actual, expected)).toBe(false); }); it("fails when comparing an empty object to an empty array (issue #114)", function() { var emptyObject = {}, emptyArray = []; - expect(j$.matchersUtil.equals(emptyObject, emptyArray)).toBe(false); - expect(j$.matchersUtil.equals(emptyArray, emptyObject)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(emptyObject, emptyArray)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(emptyArray, emptyObject)).toBe(false); }); it("passes for equivalent frozen objects (GitHub issue #266)", function() { @@ -129,7 +129,7 @@ describe("matchersUtil", function() { Object.freeze(a); Object.freeze(b); - expect(j$.matchersUtil.equals(a,b)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(a,b)).toBe(true); }); it("passes for equivalent DOM nodes", function() { @@ -144,7 +144,7 @@ describe("matchersUtil", function() { b.setAttribute("test-attr", "attr-value") b.appendChild(document.createTextNode('test')); - expect(j$.matchersUtil.equals(a,b)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(a,b)).toBe(true); }); it("fails for DOM nodes with different attributes or child nodes", function() { @@ -159,16 +159,16 @@ describe("matchersUtil", function() { b.setAttribute("test-attr", "attr-value2") b.appendChild(document.createTextNode('test')); - expect(j$.matchersUtil.equals(a,b)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(a,b)).toBe(false); b.setAttribute("test-attr", "attr-value"); - expect(j$.matchersUtil.equals(a,b)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(a,b)).toBe(true); b.appendChild(document.createTextNode('2')); - expect(j$.matchersUtil.equals(a,b)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(a,b)).toBe(false); a.appendChild(document.createTextNode('2')); - expect(j$.matchersUtil.equals(a,b)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(a,b)).toBe(true); }); it("passes for equivalent objects from different vm contexts", function() { @@ -181,7 +181,7 @@ describe("matchersUtil", function() { }; vm.runInNewContext('obj = {a: 1, b: 2}', sandbox); - expect(j$.matchersUtil.equals(sandbox.obj, {a: 1, b: 2})).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(sandbox.obj, {a: 1, b: 2})).toBe(true); }); it("passes for equivalent arrays from different vm contexts", function() { @@ -195,23 +195,23 @@ describe("matchersUtil", function() { }; vm.runInNewContext('arr = [1, 2]', sandbox); - expect(j$.matchersUtil.equals(sandbox.arr, [1, 2])).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(sandbox.arr, [1, 2])).toBe(true); }); it("passes when Any is used", function() { var number = 3, - anyNumber = new j$.Any(Number); + anyNumber = new jasmineUnderTest.Any(Number); - expect(j$.matchersUtil.equals(number, anyNumber)).toBe(true); - expect(j$.matchersUtil.equals(anyNumber, number)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(number, anyNumber)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(anyNumber, number)).toBe(true); }); it("fails when Any is compared to something unexpected", function() { var number = 3, - anyString = new j$.Any(String); + anyString = new jasmineUnderTest.Any(String); - expect(j$.matchersUtil.equals(number, anyString)).toBe(false); - expect(j$.matchersUtil.equals(anyString, number)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(number, anyString)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(anyString, number)).toBe(false); }); it("passes when ObjectContaining is used", function() { @@ -219,69 +219,69 @@ describe("matchersUtil", function() { foo: 3, bar: 7 }, - containing = new j$.ObjectContaining({foo: 3}); + containing = new jasmineUnderTest.ObjectContaining({foo: 3}); - expect(j$.matchersUtil.equals(obj, containing)).toBe(true); - expect(j$.matchersUtil.equals(containing, obj)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(obj, containing)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(containing, obj)).toBe(true); }); it("passes when an asymmetric equality tester returns true", function() { var tester = { asymmetricMatch: function(other) { return true; } }; - expect(j$.matchersUtil.equals(false, tester)).toBe(true); - expect(j$.matchersUtil.equals(tester, false)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(false, tester)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(tester, false)).toBe(true); }); it("fails when an asymmetric equality tester returns false", function() { var tester = { asymmetricMatch: function(other) { return false; } }; - expect(j$.matchersUtil.equals(true, tester)).toBe(false); - expect(j$.matchersUtil.equals(tester, true)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(true, tester)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(tester, true)).toBe(false); }); it("passes when ArrayContaining is used", function() { var arr = ["foo", "bar"]; - expect(j$.matchersUtil.equals(arr, new j$.ArrayContaining(["bar"]))).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(arr, new jasmineUnderTest.ArrayContaining(["bar"]))).toBe(true); }); it("passes when a custom equality matcher returns true", function() { var tester = function(a, b) { return true; }; - expect(j$.matchersUtil.equals(1, 2, [tester])).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(1, 2, [tester])).toBe(true); }); it("passes for two empty Objects", function () { - expect(j$.matchersUtil.equals({}, {})).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals({}, {})).toBe(true); }); describe("when a custom equality matcher is installed that returns 'undefined'", function () { var tester = function(a, b) { return jasmine.undefined; }; it("passes for two empty Objects", function () { - expect(j$.matchersUtil.equals({}, {}, [tester])).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals({}, {}, [tester])).toBe(true); }); }); it("fails for equivalents when a custom equality matcher returns false", function() { var tester = function(a, b) { return false; }; - expect(j$.matchersUtil.equals(1, 1, [tester])).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(1, 1, [tester])).toBe(false); }); it("passes for an asymmetric equality tester that returns true when a custom equality tester return false", function() { var asymmetricTester = { asymmetricMatch: function(other) { return true; } }, symmetricTester = function(a, b) { return false; }; - expect(j$.matchersUtil.equals(asymmetricTester, true, [symmetricTester])).toBe(true); - expect(j$.matchersUtil.equals(true, asymmetricTester, [symmetricTester])).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(asymmetricTester, true, [symmetricTester])).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(true, asymmetricTester, [symmetricTester])).toBe(true); }); it("passes when an Any is compared to an Any that checks for the same type", function() { - var any1 = new j$.Any(Function), - any2 = new j$.Any(Function); + var any1 = new jasmineUnderTest.Any(Function), + any2 = new jasmineUnderTest.Any(Function); - expect(j$.matchersUtil.equals(any1, any2)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(any1, any2)).toBe(true); }); it("passes for null prototype objects with same properties", function () { @@ -293,7 +293,7 @@ describe("matchersUtil", function() { objA.name = 'test'; objB.name = 'test'; - expect(j$.matchersUtil.equals(objA, objB)).toBe(true); + expect(jasmineUnderTest.matchersUtil.equals(objA, objB)).toBe(true); }); it("fails for null prototype objects with different properties", function () { @@ -305,44 +305,44 @@ describe("matchersUtil", function() { objA.name = 'test'; objB.test = 'name'; - expect(j$.matchersUtil.equals(objA, objB)).toBe(false); + expect(jasmineUnderTest.matchersUtil.equals(objA, objB)).toBe(false); }); }); describe("contains", function() { it("passes when expected is a substring of actual", function() { - expect(j$.matchersUtil.contains("ABC", "BC")).toBe(true); + expect(jasmineUnderTest.matchersUtil.contains("ABC", "BC")).toBe(true); }); it("fails when expected is a not substring of actual", function() { - expect(j$.matchersUtil.contains("ABC", "X")).toBe(false); + expect(jasmineUnderTest.matchersUtil.contains("ABC", "X")).toBe(false); }); it("passes when expected is an element in an actual array", function() { - expect(j$.matchersUtil.contains(['foo', 'bar'], 'foo')).toBe(true); + expect(jasmineUnderTest.matchersUtil.contains(['foo', 'bar'], 'foo')).toBe(true); }); it("fails when expected is not an element in an actual array", function() { - expect(j$.matchersUtil.contains(['foo', 'bar'], 'baz')).toBe(false); + expect(jasmineUnderTest.matchersUtil.contains(['foo', 'bar'], 'baz')).toBe(false); }); it("passes with mixed-element arrays", function() { - expect(j$.matchersUtil.contains(["foo", {some: "bar"}], "foo")).toBe(true); - expect(j$.matchersUtil.contains(["foo", {some: "bar"}], {some: "bar"})).toBe(true); + expect(jasmineUnderTest.matchersUtil.contains(["foo", {some: "bar"}], "foo")).toBe(true); + expect(jasmineUnderTest.matchersUtil.contains(["foo", {some: "bar"}], {some: "bar"})).toBe(true); }); it("uses custom equality testers if passed in and actual is an Array", function() { var customTester = function(a, b) {return true;}; - expect(j$.matchersUtil.contains([1, 2], 2, [customTester])).toBe(true); + expect(jasmineUnderTest.matchersUtil.contains([1, 2], 2, [customTester])).toBe(true); }); it("fails when actual is undefined", function() { - expect(j$.matchersUtil.contains(undefined, 'A')).toBe(false); + expect(jasmineUnderTest.matchersUtil.contains(undefined, 'A')).toBe(false); }); it("fails when actual is null", function() { - expect(j$.matchersUtil.contains(null, 'A')).toBe(false); + expect(jasmineUnderTest.matchersUtil.contains(null, 'A')).toBe(false); }); it("passes with array-like objects", function() { @@ -351,7 +351,7 @@ describe("matchersUtil", function() { capturedArgs = arguments; } testFunction('foo', 'bar'); - expect(j$.matchersUtil.contains(capturedArgs, 'bar')).toBe(true); + expect(jasmineUnderTest.matchersUtil.contains(capturedArgs, 'bar')).toBe(true); }); }); @@ -360,7 +360,7 @@ describe("matchersUtil", function() { it("builds an English sentence for a failure case", function() { var actual = "foo", name = "toBar", - message = j$.matchersUtil.buildFailureMessage(name, false, actual); + message = jasmineUnderTest.matchersUtil.buildFailureMessage(name, false, actual); expect(message).toEqual("Expected 'foo' to bar."); }); @@ -369,7 +369,7 @@ describe("matchersUtil", function() { var actual = "foo", name = "toBar", isNot = true, - message = message = j$.matchersUtil.buildFailureMessage(name, isNot, actual); + message = message = jasmineUnderTest.matchersUtil.buildFailureMessage(name, isNot, actual); expect(message).toEqual("Expected 'foo' not to bar."); }); @@ -377,7 +377,7 @@ describe("matchersUtil", function() { it("builds an English sentence for an arbitrary array of expected arguments", function() { var actual = "foo", name = "toBar", - message = j$.matchersUtil.buildFailureMessage(name, false, actual, "quux", "corge"); + message = jasmineUnderTest.matchersUtil.buildFailureMessage(name, false, actual, "quux", "corge"); expect(message).toEqual("Expected 'foo' to bar 'quux', 'corge'."); }); diff --git a/spec/core/matchers/toBeCloseToSpec.js b/spec/core/matchers/toBeCloseToSpec.js index c7975bd0..8c892958 100644 --- a/spec/core/matchers/toBeCloseToSpec.js +++ b/spec/core/matchers/toBeCloseToSpec.js @@ -1,6 +1,6 @@ describe("toBeCloseTo", function() { it("passes when within two decimal places by default", function() { - var matcher = j$.matchers.toBeCloseTo(), + var matcher = jasmineUnderTest.matchers.toBeCloseTo(), result; result = matcher.compare(0, 0); @@ -11,7 +11,7 @@ describe("toBeCloseTo", function() { }); it("fails when not within two decimal places by default", function() { - var matcher = j$.matchers.toBeCloseTo(), + var matcher = jasmineUnderTest.matchers.toBeCloseTo(), result; result = matcher.compare(0, 0.01); @@ -19,7 +19,7 @@ describe("toBeCloseTo", function() { }); it("accepts an optional precision argument", function() { - var matcher = j$.matchers.toBeCloseTo(), + var matcher = jasmineUnderTest.matchers.toBeCloseTo(), result; result = matcher.compare(0, 0.1, 0); @@ -30,7 +30,7 @@ describe("toBeCloseTo", function() { }); it("rounds expected values", function() { - var matcher = j$.matchers.toBeCloseTo(), + var matcher = jasmineUnderTest.matchers.toBeCloseTo(), result; result = matcher.compare(1.23, 1.229); diff --git a/spec/core/matchers/toBeDefinedSpec.js b/spec/core/matchers/toBeDefinedSpec.js index 7e6626a6..5649f423 100644 --- a/spec/core/matchers/toBeDefinedSpec.js +++ b/spec/core/matchers/toBeDefinedSpec.js @@ -1,6 +1,6 @@ describe("toBeDefined", function() { it("matches for defined values", function() { - var matcher = j$.matchers.toBeDefined(), + var matcher = jasmineUnderTest.matchers.toBeDefined(), result; @@ -9,7 +9,7 @@ describe("toBeDefined", function() { }); it("fails when matching undefined values", function() { - var matcher = j$.matchers.toBeDefined(), + var matcher = jasmineUnderTest.matchers.toBeDefined(), result; result = matcher.compare(void 0); diff --git a/spec/core/matchers/toBeFalsySpec.js b/spec/core/matchers/toBeFalsySpec.js index aa612838..2099234f 100644 --- a/spec/core/matchers/toBeFalsySpec.js +++ b/spec/core/matchers/toBeFalsySpec.js @@ -1,6 +1,6 @@ describe("toBeFalsy", function() { it("passes for 'falsy' values", function() { - var matcher = j$.matchers.toBeFalsy(), + var matcher = jasmineUnderTest.matchers.toBeFalsy(), result; result = matcher.compare(false); @@ -20,7 +20,7 @@ describe("toBeFalsy", function() { }); it("fails for 'truthy' values", function() { - var matcher = j$.matchers.toBeFalsy(), + var matcher = jasmineUnderTest.matchers.toBeFalsy(), result; result = matcher.compare(true); diff --git a/spec/core/matchers/toBeGreaterThanSpec.js b/spec/core/matchers/toBeGreaterThanSpec.js index c530dcfd..75b92824 100644 --- a/spec/core/matchers/toBeGreaterThanSpec.js +++ b/spec/core/matchers/toBeGreaterThanSpec.js @@ -1,6 +1,6 @@ describe("toBeGreaterThan", function() { it("passes when actual > expected", function() { - var matcher = j$.matchers.toBeGreaterThan(), + var matcher = jasmineUnderTest.matchers.toBeGreaterThan(), result; result = matcher.compare(2, 1); @@ -8,7 +8,7 @@ describe("toBeGreaterThan", function() { }); it("fails when actual <= expected", function() { - var matcher = j$.matchers.toBeGreaterThan(), + var matcher = jasmineUnderTest.matchers.toBeGreaterThan(), result; result = matcher.compare(1, 1); diff --git a/spec/core/matchers/toBeLessThanSpec.js b/spec/core/matchers/toBeLessThanSpec.js index 53938d2c..55868ec5 100644 --- a/spec/core/matchers/toBeLessThanSpec.js +++ b/spec/core/matchers/toBeLessThanSpec.js @@ -1,6 +1,6 @@ describe("toBeLessThan", function() { it("passes when actual < expected", function() { - var matcher = j$.matchers.toBeLessThan(), + var matcher = jasmineUnderTest.matchers.toBeLessThan(), result; result = matcher.compare(1, 2); @@ -8,7 +8,7 @@ describe("toBeLessThan", function() { }); it("fails when actual <= expected", function() { - var matcher = j$.matchers.toBeLessThan(), + var matcher = jasmineUnderTest.matchers.toBeLessThan(), result; result = matcher.compare(1, 1); diff --git a/spec/core/matchers/toBeNaNSpec.js b/spec/core/matchers/toBeNaNSpec.js index 4c82a0f7..b490d089 100644 --- a/spec/core/matchers/toBeNaNSpec.js +++ b/spec/core/matchers/toBeNaNSpec.js @@ -1,6 +1,6 @@ describe("toBeNaN", function() { it("passes for NaN with a custom .not fail", function() { - var matcher = j$.matchers.toBeNaN(), + var matcher = jasmineUnderTest.matchers.toBeNaN(), result; result = matcher.compare(Number.NaN); @@ -9,7 +9,7 @@ describe("toBeNaN", function() { }); it("fails for anything not a NaN", function() { - var matcher = j$.matchers.toBeNaN(), + var matcher = jasmineUnderTest.matchers.toBeNaN(), result; result = matcher.compare(1); @@ -29,7 +29,7 @@ describe("toBeNaN", function() { }); it("has a custom message on failure", function() { - var matcher = j$.matchers.toBeNaN(), + var matcher = jasmineUnderTest.matchers.toBeNaN(), result = matcher.compare(0); expect(result.message()).toEqual("Expected 0 to be NaN."); diff --git a/spec/core/matchers/toBeNullSpec.js b/spec/core/matchers/toBeNullSpec.js index 8a178d5c..35dfe8d1 100644 --- a/spec/core/matchers/toBeNullSpec.js +++ b/spec/core/matchers/toBeNullSpec.js @@ -1,6 +1,6 @@ describe("toBeNull", function() { it("passes for null", function() { - var matcher = j$.matchers.toBeNull(), + var matcher = jasmineUnderTest.matchers.toBeNull(), result; result = matcher.compare(null); @@ -8,7 +8,7 @@ describe("toBeNull", function() { }); it("fails for non-null", function() { - var matcher = j$.matchers.toBeNull(), + var matcher = jasmineUnderTest.matchers.toBeNull(), result; result = matcher.compare('foo'); diff --git a/spec/core/matchers/toBeSpec.js b/spec/core/matchers/toBeSpec.js index 908c2978..541eda96 100644 --- a/spec/core/matchers/toBeSpec.js +++ b/spec/core/matchers/toBeSpec.js @@ -1,6 +1,6 @@ describe("toBe", function() { it("passes when actual === expected", function() { - var matcher = j$.matchers.toBe(), + var matcher = jasmineUnderTest.matchers.toBe(), result; result = matcher.compare(1, 1); @@ -8,7 +8,7 @@ describe("toBe", function() { }); it("fails when actual !== expected", function() { - var matcher = j$.matchers.toBe(), + var matcher = jasmineUnderTest.matchers.toBe(), result; result = matcher.compare(1, 2); diff --git a/spec/core/matchers/toBeTruthySpec.js b/spec/core/matchers/toBeTruthySpec.js index 3acb1ffe..7d5f284c 100644 --- a/spec/core/matchers/toBeTruthySpec.js +++ b/spec/core/matchers/toBeTruthySpec.js @@ -1,6 +1,6 @@ describe("toBeTruthy", function() { it("passes for 'truthy' values", function() { - var matcher = j$.matchers.toBeTruthy(), + var matcher = jasmineUnderTest.matchers.toBeTruthy(), result; result = matcher.compare(true); @@ -17,7 +17,7 @@ describe("toBeTruthy", function() { }); it("fails for 'falsy' values", function() { - var matcher = j$.matchers.toBeTruthy(), + var matcher = jasmineUnderTest.matchers.toBeTruthy(), result; result = matcher.compare(false); diff --git a/spec/core/matchers/toBeUndefinedSpec.js b/spec/core/matchers/toBeUndefinedSpec.js index eefe7451..c3588e34 100644 --- a/spec/core/matchers/toBeUndefinedSpec.js +++ b/spec/core/matchers/toBeUndefinedSpec.js @@ -1,6 +1,6 @@ describe("toBeUndefined", function() { it("passes for undefined values", function() { - var matcher = j$.matchers.toBeUndefined(), + var matcher = jasmineUnderTest.matchers.toBeUndefined(), result; result = matcher.compare(void 0); @@ -9,7 +9,7 @@ describe("toBeUndefined", function() { }); it("fails when matching defined values", function() { - var matcher = j$.matchers.toBeUndefined(), + var matcher = jasmineUnderTest.matchers.toBeUndefined(), result; result = matcher.compare('foo'); diff --git a/spec/core/matchers/toContainSpec.js b/spec/core/matchers/toContainSpec.js index 1025dffb..a56d05e4 100644 --- a/spec/core/matchers/toContainSpec.js +++ b/spec/core/matchers/toContainSpec.js @@ -1,9 +1,9 @@ describe("toContain", function() { - it("delegates to j$.matchersUtil.contains", function() { + it("delegates to jasmineUnderTest.matchersUtil.contains", function() { var util = { contains: jasmine.createSpy('delegated-contains').and.returnValue(true) }, - matcher = j$.matchers.toContain(util), + matcher = jasmineUnderTest.matchers.toContain(util), result; result = matcher.compare("ABC", "B"); @@ -11,12 +11,12 @@ describe("toContain", function() { expect(result.pass).toBe(true); }); - it("delegates to j$.matchersUtil.contains, passing in equality testers if present", function() { + it("delegates to jasmineUnderTest.matchersUtil.contains, passing in equality testers if present", function() { var util = { contains: jasmine.createSpy('delegated-contains').and.returnValue(true) }, customEqualityTesters = ['a', 'b'], - matcher = j$.matchers.toContain(util, customEqualityTesters), + matcher = jasmineUnderTest.matchers.toContain(util, customEqualityTesters), result; result = matcher.compare("ABC", "B"); diff --git a/spec/core/matchers/toEqualSpec.js b/spec/core/matchers/toEqualSpec.js index 55bfee12..f038f9e9 100644 --- a/spec/core/matchers/toEqualSpec.js +++ b/spec/core/matchers/toEqualSpec.js @@ -3,7 +3,7 @@ describe("toEqual", function() { var util = { equals: jasmine.createSpy('delegated-equals').and.returnValue(true) }, - matcher = j$.matchers.toEqual(util), + matcher = jasmineUnderTest.matchers.toEqual(util), result; result = matcher.compare(1, 1); @@ -17,7 +17,7 @@ describe("toEqual", function() { equals: jasmine.createSpy('delegated-equals').and.returnValue(true) }, customEqualityTesters = ['a', 'b'], - matcher = j$.matchers.toEqual(util, customEqualityTesters), + matcher = jasmineUnderTest.matchers.toEqual(util, customEqualityTesters), result; result = matcher.compare(1, 1); diff --git a/spec/core/matchers/toHaveBeenCalledSpec.js b/spec/core/matchers/toHaveBeenCalledSpec.js index 82d17e99..be4c89fa 100644 --- a/spec/core/matchers/toHaveBeenCalledSpec.js +++ b/spec/core/matchers/toHaveBeenCalledSpec.js @@ -1,7 +1,7 @@ describe("toHaveBeenCalled", function() { it("passes when the actual was called, with a custom .not fail message", function() { - var matcher = j$.matchers.toHaveBeenCalled(), - calledSpy = j$.createSpy('called-spy'), + var matcher = jasmineUnderTest.matchers.toHaveBeenCalled(), + calledSpy = jasmineUnderTest.createSpy('called-spy'), result; calledSpy(); @@ -12,8 +12,8 @@ describe("toHaveBeenCalled", function() { }); it("fails when the actual was not called", function() { - var matcher = j$.matchers.toHaveBeenCalled(), - uncalledSpy = j$.createSpy('uncalled spy'), + var matcher = jasmineUnderTest.matchers.toHaveBeenCalled(), + uncalledSpy = jasmineUnderTest.createSpy('uncalled spy'), result; result = matcher.compare(uncalledSpy); @@ -21,22 +21,22 @@ describe("toHaveBeenCalled", function() { }); it("throws an exception when the actual is not a spy", function() { - var matcher = j$.matchers.toHaveBeenCalled(), + var matcher = jasmineUnderTest.matchers.toHaveBeenCalled(), fn = function() {}; expect(function() { matcher.compare(fn) }).toThrow(new Error("Expected a spy, but got Function.")); }); it("throws an exception when invoked with any arguments", function() { - var matcher = j$.matchers.toHaveBeenCalled(), - spy = j$.createSpy('sample spy'); + var matcher = jasmineUnderTest.matchers.toHaveBeenCalled(), + spy = jasmineUnderTest.createSpy('sample spy'); expect(function() { matcher.compare(spy, 'foo') }).toThrow(new Error("toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith")); }); it("has a custom message on failure", function() { - var matcher = j$.matchers.toHaveBeenCalled(), - spy = j$.createSpy('sample-spy'), + var matcher = jasmineUnderTest.matchers.toHaveBeenCalled(), + spy = jasmineUnderTest.createSpy('sample-spy'), result; result = matcher.compare(spy); diff --git a/spec/core/matchers/toHaveBeenCalledTimesSpec.js b/spec/core/matchers/toHaveBeenCalledTimesSpec.js index 3953ee1e..3acef36e 100644 --- a/spec/core/matchers/toHaveBeenCalledTimesSpec.js +++ b/spec/core/matchers/toHaveBeenCalledTimesSpec.js @@ -1,7 +1,7 @@ describe("toHaveBeenCalledTimes", function() { it("passes when the actual matches the expected", function() { - var matcher = j$.matchers.toHaveBeenCalledTimes(), - calledSpy = j$.createSpy('called-spy'), + var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(), + calledSpy = jasmineUnderTest.createSpy('called-spy'), result; calledSpy(); @@ -10,8 +10,8 @@ describe("toHaveBeenCalledTimes", function() { }); it("fails when expected numbers is not supplied", function(){ - var matcher = j$.matchers.toHaveBeenCalledTimes(), - spy = j$.createSpy('spy'), + var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(), + spy = jasmineUnderTest.createSpy('spy'), result; spy(); @@ -21,8 +21,8 @@ describe("toHaveBeenCalledTimes", function() { }); it("fails when the actual was called less than the expected", function() { - var matcher = j$.matchers.toHaveBeenCalledTimes(), - uncalledSpy = j$.createSpy('uncalled spy'), + var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(), + uncalledSpy = jasmineUnderTest.createSpy('uncalled spy'), result; result = matcher.compare(uncalledSpy, 2); @@ -30,8 +30,8 @@ describe("toHaveBeenCalledTimes", function() { }); it("fails when the actual was called more than expected", function() { - var matcher = j$.matchers.toHaveBeenCalledTimes(), - uncalledSpy = j$.createSpy('uncalled spy'), + var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(), + uncalledSpy = jasmineUnderTest.createSpy('uncalled spy'), result; uncalledSpy(); @@ -42,7 +42,7 @@ describe("toHaveBeenCalledTimes", function() { }); it("throws an exception when the actual is not a spy", function() { - var matcher = j$.matchers.toHaveBeenCalledTimes(), + var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(), fn = function() {}; expect(function() { @@ -51,8 +51,8 @@ describe("toHaveBeenCalledTimes", function() { }); it("has a custom message on failure that tells it was called only once", function() { - var matcher = j$.matchers.toHaveBeenCalledTimes(), - spy = j$.createSpy('sample-spy'), + var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(), + spy = jasmineUnderTest.createSpy('sample-spy'), result; spy(); spy(); @@ -65,8 +65,8 @@ describe("toHaveBeenCalledTimes", function() { }); it("has a custom message on failure that tells how many times it was called", function() { - var matcher = j$.matchers.toHaveBeenCalledTimes(), - spy = j$.createSpy('sample-spy'), + var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(), + spy = jasmineUnderTest.createSpy('sample-spy'), result; spy(); spy(); diff --git a/spec/core/matchers/toHaveBeenCalledWithSpec.js b/spec/core/matchers/toHaveBeenCalledWithSpec.js index 0dd3ad7a..15d0aec0 100644 --- a/spec/core/matchers/toHaveBeenCalledWithSpec.js +++ b/spec/core/matchers/toHaveBeenCalledWithSpec.js @@ -3,8 +3,8 @@ describe("toHaveBeenCalledWith", function() { var util = { contains: jasmine.createSpy('delegated-contains').and.returnValue(true) }, - matcher = j$.matchers.toHaveBeenCalledWith(util), - calledSpy = j$.createSpy('called-spy'), + matcher = jasmineUnderTest.matchers.toHaveBeenCalledWith(util), + calledSpy = jasmineUnderTest.createSpy('called-spy'), result; calledSpy('a', 'b'); @@ -19,8 +19,8 @@ describe("toHaveBeenCalledWith", function() { contains: jasmine.createSpy('delegated-contains').and.returnValue(true) }, customEqualityTesters = [function() { return true; }], - matcher = j$.matchers.toHaveBeenCalledWith(util, customEqualityTesters), - calledSpy = j$.createSpy('called-spy'); + matcher = jasmineUnderTest.matchers.toHaveBeenCalledWith(util, customEqualityTesters), + calledSpy = jasmineUnderTest.createSpy('called-spy'); calledSpy('a', 'b'); matcher.compare(calledSpy, 'a', 'b'); @@ -32,8 +32,8 @@ describe("toHaveBeenCalledWith", function() { var util = { contains: jasmine.createSpy('delegated-contains').and.returnValue(false) }, - matcher = j$.matchers.toHaveBeenCalledWith(util), - uncalledSpy = j$.createSpy('uncalled spy'), + matcher = jasmineUnderTest.matchers.toHaveBeenCalledWith(util), + uncalledSpy = jasmineUnderTest.createSpy('uncalled spy'), result; result = matcher.compare(uncalledSpy); @@ -45,8 +45,8 @@ describe("toHaveBeenCalledWith", function() { var util = { contains: jasmine.createSpy('delegated-contains').and.returnValue(false) }, - matcher = j$.matchers.toHaveBeenCalledWith(util), - calledSpy = j$.createSpy('called spy'), + matcher = jasmineUnderTest.matchers.toHaveBeenCalledWith(util), + calledSpy = jasmineUnderTest.createSpy('called spy'), result; calledSpy('a'); @@ -58,7 +58,7 @@ describe("toHaveBeenCalledWith", function() { }); it("throws an exception when the actual is not a spy", function() { - var matcher = j$.matchers.toHaveBeenCalledWith(), + var matcher = jasmineUnderTest.matchers.toHaveBeenCalledWith(), fn = function() {}; expect(function() { matcher.compare(fn) }).toThrow(new Error("Expected a spy, but got Function.")); diff --git a/spec/core/matchers/toMatchSpec.js b/spec/core/matchers/toMatchSpec.js index dee3e774..85cfd05f 100644 --- a/spec/core/matchers/toMatchSpec.js +++ b/spec/core/matchers/toMatchSpec.js @@ -1,6 +1,6 @@ describe("toMatch", function() { it("passes when RegExps are equivalent", function() { - var matcher = j$.matchers.toMatch(), + var matcher = jasmineUnderTest.matchers.toMatch(), result; result = matcher.compare(/foo/, /foo/); @@ -8,7 +8,7 @@ describe("toMatch", function() { }); it("fails when RegExps are not equivalent", function() { - var matcher = j$.matchers.toMatch(), + var matcher = jasmineUnderTest.matchers.toMatch(), result; result = matcher.compare(/bar/, /foo/); @@ -16,7 +16,7 @@ describe("toMatch", function() { }); it("passes when the actual matches the expected string as a pattern", function() { - var matcher = j$.matchers.toMatch(), + var matcher = jasmineUnderTest.matchers.toMatch(), result; result = matcher.compare('foosball', 'foo'); @@ -24,7 +24,7 @@ describe("toMatch", function() { }); it("fails when the actual matches the expected string as a pattern", function() { - var matcher = j$.matchers.toMatch(), + var matcher = jasmineUnderTest.matchers.toMatch(), result; result = matcher.compare('bar', 'foo'); @@ -32,7 +32,7 @@ describe("toMatch", function() { }); it("throws an Error when the expected is not a String or RegExp", function() { - var matcher = j$.matchers.toMatch(); + var matcher = jasmineUnderTest.matchers.toMatch(); expect(function() { matcher.compare('foo', { bar: 'baz' }); diff --git a/spec/core/matchers/toThrowErrorSpec.js b/spec/core/matchers/toThrowErrorSpec.js index ebf3e21e..8af0b343 100644 --- a/spec/core/matchers/toThrowErrorSpec.js +++ b/spec/core/matchers/toThrowErrorSpec.js @@ -1,6 +1,6 @@ describe("toThrowError", function() { it("throws an error when the actual is not a function", function() { - var matcher = j$.matchers.toThrowError(); + var matcher = jasmineUnderTest.matchers.toThrowError(); expect(function() { matcher.compare({}); @@ -8,7 +8,7 @@ describe("toThrowError", function() { }); it("throws an error when the expected is not an Error, string, or RegExp", function() { - var matcher = j$.matchers.toThrowError(), + var matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new Error("foo"); }; @@ -19,7 +19,7 @@ describe("toThrowError", function() { }); it("throws an error when the expected error type is not an Error", function() { - var matcher = j$.matchers.toThrowError(), + var matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new Error("foo"); }; @@ -30,7 +30,7 @@ describe("toThrowError", function() { }); it("throws an error when the expected error message is not a string or RegExp", function() { - var matcher = j$.matchers.toThrowError(), + var matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new Error("foo"); }; @@ -41,7 +41,7 @@ describe("toThrowError", function() { }); it("fails if actual does not throw at all", function() { - var matcher = j$.matchers.toThrowError(), + var matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { return true; }, @@ -54,7 +54,7 @@ describe("toThrowError", function() { }); it("fails if thrown is not an instanceof Error", function() { - var matcher = j$.matchers.toThrowError(), + var matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw 4; }, @@ -66,7 +66,7 @@ describe("toThrowError", function() { }); it("fails with the correct message if thrown is a falsy value", function() { - var matcher = j$.matchers.toThrowError(), + var matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw undefined; }, @@ -78,7 +78,7 @@ describe("toThrowError", function() { }); it("passes if thrown is a type of Error, but there is no expected error", function() { - var matcher = j$.matchers.toThrowError(), + var matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new TypeError(); }, @@ -91,7 +91,7 @@ describe("toThrowError", function() { }); it("passes if thrown is an Error and the expected is the same message", function() { - var matcher = j$.matchers.toThrowError(), + var matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new Error("foo"); }, @@ -104,7 +104,7 @@ describe("toThrowError", function() { }); it("fails if thrown is an Error and the expected is not the same message", function() { - var matcher = j$.matchers.toThrowError(), + var matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new Error("foo"); }, @@ -117,7 +117,7 @@ describe("toThrowError", function() { }); it("passes if thrown is an Error and the expected is a RegExp that matches the message", function() { - var matcher = j$.matchers.toThrowError(), + var matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new Error("a long message"); }, @@ -130,7 +130,7 @@ describe("toThrowError", function() { }); it("fails if thrown is an Error and the expected is a RegExp that does not match the message", function() { - var matcher = j$.matchers.toThrowError(), + var matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new Error("a long message"); }, @@ -146,7 +146,7 @@ describe("toThrowError", function() { var util = { equals: jasmine.createSpy('delegated-equal').and.returnValue(true) }, - matcher = j$.matchers.toThrowError(), + matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new Error(); }, @@ -162,7 +162,7 @@ describe("toThrowError", function() { var util = { equals: jasmine.createSpy('delegated-equal').and.returnValue(true) }, - matcher = j$.matchers.toThrowError(), + matcher = jasmineUnderTest.matchers.toThrowError(), CustomError = function CustomError(arg) { arg.x }, fn = function() { throw new CustomError({ x: 1 }); @@ -181,7 +181,7 @@ describe("toThrowError", function() { var util = { equals: jasmine.createSpy('delegated-equal').and.returnValue(false) }, - matcher = j$.matchers.toThrowError(), + matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new Error(); }, @@ -197,7 +197,7 @@ describe("toThrowError", function() { var util = { equals: jasmine.createSpy('delegated-equal').and.returnValue(true) }, - matcher = j$.matchers.toThrowError(), + matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new TypeError("foo"); }, @@ -213,7 +213,7 @@ describe("toThrowError", function() { var util = { equals: jasmine.createSpy('delegated-equal').and.returnValue(true) }, - matcher = j$.matchers.toThrowError(), + matcher = jasmineUnderTest.matchers.toThrowError(), CustomError = function CustomError(arg) { this.message = arg.message }, fn = function() { throw new CustomError({message: "foo"}); @@ -232,7 +232,7 @@ describe("toThrowError", function() { var util = { equals: jasmine.createSpy('delegated-equal').and.returnValue(false) }, - matcher = j$.matchers.toThrowError(), + matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new TypeError("foo"); }, @@ -248,7 +248,7 @@ describe("toThrowError", function() { var util = { equals: jasmine.createSpy('delegated-equal').and.returnValue(true) }, - matcher = j$.matchers.toThrowError(), + matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new TypeError("foo"); }, @@ -264,7 +264,7 @@ describe("toThrowError", function() { var util = { equals: jasmine.createSpy('delegated-equal').and.returnValue(false) }, - matcher = j$.matchers.toThrowError(), + matcher = jasmineUnderTest.matchers.toThrowError(), fn = function() { throw new TypeError("foo"); }, diff --git a/spec/core/matchers/toThrowSpec.js b/spec/core/matchers/toThrowSpec.js index 33485628..e232156b 100644 --- a/spec/core/matchers/toThrowSpec.js +++ b/spec/core/matchers/toThrowSpec.js @@ -1,6 +1,6 @@ describe("toThrow", function() { it("throws an error when the actual is not a function", function() { - var matcher = j$.matchers.toThrow(); + var matcher = jasmineUnderTest.matchers.toThrow(); expect(function() { matcher.compare({}); @@ -9,7 +9,7 @@ describe("toThrow", function() { }); it("fails if actual does not throw", function() { - var matcher = j$.matchers.toThrow(), + var matcher = jasmineUnderTest.matchers.toThrow(), fn = function() { return true; }, @@ -25,7 +25,7 @@ describe("toThrow", function() { var util = { equals: jasmine.createSpy('delegated-equal').and.returnValue(true) }, - matcher = j$.matchers.toThrow(util), + matcher = jasmineUnderTest.matchers.toThrow(util), fn = function() { throw 5; }, @@ -38,7 +38,7 @@ describe("toThrow", function() { }); it("passes even if what is thrown is falsy", function() { - var matcher = j$.matchers.toThrow(), + var matcher = jasmineUnderTest.matchers.toThrow(), fn = function() { throw undefined; }, @@ -53,7 +53,7 @@ describe("toThrow", function() { var util = { equals: jasmine.createSpy('delegated-equal').and.returnValue(true) }, - matcher = j$.matchers.toThrow(util), + matcher = jasmineUnderTest.matchers.toThrow(util), fn = function() { throw 5; }, @@ -69,7 +69,7 @@ describe("toThrow", function() { var util = { equals: jasmine.createSpy('delegated-equal').and.returnValue(false) }, - matcher = j$.matchers.toThrow(util), + matcher = jasmineUnderTest.matchers.toThrow(util), fn = function() { throw 5; }, @@ -85,7 +85,7 @@ describe("toThrow", function() { var util = { equals: jasmine.createSpy('delegated-equal').and.returnValue(false) }, - matcher = j$.matchers.toThrow(util), + matcher = jasmineUnderTest.matchers.toThrow(util), fn = function() { throw 5; }, diff --git a/spec/helpers/defineJasmineUnderTest.js b/spec/helpers/defineJasmineUnderTest.js index 3fac8f90..b586c77a 100644 --- a/spec/helpers/defineJasmineUnderTest.js +++ b/spec/helpers/defineJasmineUnderTest.js @@ -1,7 +1,7 @@ (function() { // By the time onload is called, jasmineRequire will be redefined to point // to the Jasmine source files (and not jasmine.js). So re-require - window.j$ = jasmineRequire.core(jasmineRequire); - jasmineRequire.html(j$); - jasmineRequire.console(jasmineRequire, j$); + window.jasmineUnderTest = jasmineRequire.core(jasmineRequire); + jasmineRequire.html(jasmineUnderTest); + jasmineRequire.console(jasmineRequire, jasmineUnderTest); })(); diff --git a/spec/helpers/nodeDefineJasmineUnderTest.js b/spec/helpers/nodeDefineJasmineUnderTest.js index 4525ca10..f1b4d97a 100644 --- a/spec/helpers/nodeDefineJasmineUnderTest.js +++ b/spec/helpers/nodeDefineJasmineUnderTest.js @@ -4,10 +4,10 @@ var glob = require("glob"); - var j$Require = require(path.join(__dirname, "../../src/core/requireCore.js")); + var jasmineUnderTestRequire = require(path.join(__dirname, "../../src/core/requireCore.js")); global.getJasmineRequireObj = function () { - return j$Require; + return jasmineUnderTestRequire; }; function extend(destination, source) { @@ -25,9 +25,9 @@ }); } - extend(j$Require, require(path.join(__dirname,"../../src/console/requireConsole.js"))); + extend(jasmineUnderTestRequire, require(path.join(__dirname,"../../src/console/requireConsole.js"))); getSourceFiles(); - global.j$ = j$Require.core(j$Require); + global.jasmineUnderTest = jasmineUnderTestRequire.core(jasmineUnderTestRequire); - j$Require.console(j$Require, j$); + jasmineUnderTestRequire.console(jasmineUnderTestRequire, jasmineUnderTest); })(); diff --git a/spec/html/HtmlReporterSpec.js b/spec/html/HtmlReporterSpec.js index 12d92317..e7a0c0ee 100644 --- a/spec/html/HtmlReporterSpec.js +++ b/spec/html/HtmlReporterSpec.js @@ -1,10 +1,10 @@ describe("New HtmlReporter", function() { // TODO: Figure out why this isn't rendering... it("builds the initial DOM elements, including the title banner", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -29,14 +29,14 @@ describe("New HtmlReporter", function() { var version = banner.querySelector(".jasmine-version"), versionText = 'textContent' in version ? version.textContent : version.innerText; - expect(versionText).toEqual(j$.version); + expect(versionText).toEqual(jasmineUnderTest.version); }); it("builds a single reporter even if initialized multiple times", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -52,7 +52,7 @@ describe("New HtmlReporter", function() { it("starts the timer when jasmine begins", function() { var env = new jasmine.Env(), startTimerSpy = jasmine.createSpy("start-timer-spy"), - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, createElement: function() { return document.createElement.apply(document, arguments); }, timer: { start: startTimerSpy } @@ -69,10 +69,10 @@ describe("New HtmlReporter", function() { console = { error: function(){} }; } - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement('div'), getContainer = function() {return container;}, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -95,10 +95,10 @@ describe("New HtmlReporter", function() { }); it("reports the status symbol of a disabled spec", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -115,10 +115,10 @@ describe("New HtmlReporter", function() { }); it("reports the status symbol of a pending spec", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -134,10 +134,10 @@ describe("New HtmlReporter", function() { }); it("reports the status symbol of a passing spec", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -154,10 +154,10 @@ describe("New HtmlReporter", function() { }); it("reports the status symbol of a failing spec", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -181,10 +181,10 @@ describe("New HtmlReporter", function() { describe("when there are suite failures", function () { it("displays the exceptions in their own alert bars", function(){ - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -212,10 +212,10 @@ describe("New HtmlReporter", function() { if (!window.console) { window.console = { error: function(){} }; } - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement('div'), getContainer = function() {return container;}, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -247,11 +247,11 @@ describe("New HtmlReporter", function() { }); it("reports the run time", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), timer = jasmine.createSpyObj('timer', ['start', 'elapsed']), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -271,10 +271,10 @@ describe("New HtmlReporter", function() { }); it("reports the suite and spec names with status", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -365,12 +365,12 @@ describe("New HtmlReporter", function() { }); it("has an options menu", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { @@ -400,12 +400,12 @@ describe("New HtmlReporter", function() { describe("UI for raising/catching exceptions", function() { it("should be unchecked if the env is catching", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { @@ -424,12 +424,12 @@ describe("New HtmlReporter", function() { }); it("should be checked if the env is not catching", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { @@ -449,13 +449,13 @@ describe("New HtmlReporter", function() { }); it("should affect the query param for catching exceptions", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), exceptionsClickHandler = jasmine.createSpy("raise exceptions checked"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, onRaiseExceptionsClick: exceptionsClickHandler, @@ -478,12 +478,12 @@ describe("New HtmlReporter", function() { describe("UI for throwing errors on expectation failures", function() { it("should be unchecked if not throwing", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { @@ -502,12 +502,12 @@ describe("New HtmlReporter", function() { }); it("should be checked if throwing", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { @@ -528,13 +528,13 @@ describe("New HtmlReporter", function() { }); it("should affect the query param for throw expectation failures", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), throwingExceptionHandler = jasmine.createSpy('throwingExceptions'), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, onThrowExpectationsClick: throwingExceptionHandler, @@ -558,12 +558,12 @@ describe("New HtmlReporter", function() { describe("UI for running tests in random order", function() { it("should be unchecked if not randomizing", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { @@ -582,12 +582,12 @@ describe("New HtmlReporter", function() { }); it("should be checked if randomizing", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { @@ -607,13 +607,13 @@ describe("New HtmlReporter", function() { }); it("should affect the query param for random tests", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), randomHandler = jasmine.createSpy('randomHandler'), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, onRandomClick: randomHandler, @@ -635,12 +635,12 @@ describe("New HtmlReporter", function() { }); it("should show the seed bar if randomizing", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { @@ -667,12 +667,12 @@ describe("New HtmlReporter", function() { }); it("should not show the current seed bar if not randomizing", function() { - var env = new j$.Env(), + var env = new jasmineUnderTest.Env(), container = document.createElement("div"), getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { @@ -694,10 +694,10 @@ describe("New HtmlReporter", function() { it("shows a message if no specs are run", function(){ var env, container, reporter; - env = new j$.Env(); + env = new jasmineUnderTest.Env(); container = document.createElement("div"); var getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -716,10 +716,10 @@ describe("New HtmlReporter", function() { describe("and all specs pass", function() { var env, container, reporter; beforeEach(function() { - env = new j$.Env(); + env = new jasmineUnderTest.Env(); container = document.createElement("div"); var getContainer = function() { return container; }, - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -771,10 +771,10 @@ describe("New HtmlReporter", function() { describe("and there are pending specs", function() { var env, container, reporter; beforeEach(function() { - env = new j$.Env(); + env = new jasmineUnderTest.Env(); container = document.createElement("div"); var getContainer = function() { return container; }; - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, @@ -820,10 +820,10 @@ describe("New HtmlReporter", function() { var env, container, reporter; beforeEach(function() { - env = new j$.Env(); + env = new jasmineUnderTest.Env(); container = document.createElement("div"); var getContainer = function() { return container; } - reporter = new j$.HtmlReporter({ + reporter = new jasmineUnderTest.HtmlReporter({ env: env, getContainer: getContainer, createElement: function() { return document.createElement.apply(document, arguments); }, diff --git a/spec/html/HtmlSpecFilterSpec.js b/spec/html/HtmlSpecFilterSpec.js index 8bc2eb14..8a3387c0 100644 --- a/spec/html/HtmlSpecFilterSpec.js +++ b/spec/html/HtmlSpecFilterSpec.js @@ -1,14 +1,14 @@ -describe("j$.HtmlSpecFilter", function() { +describe("jasmineUnderTest.HtmlSpecFilter", function() { it("should match when no string is provided", function() { - var specFilter = new j$.HtmlSpecFilter(); + var specFilter = new jasmineUnderTest.HtmlSpecFilter(); expect(specFilter.matches("foo")).toBe(true); expect(specFilter.matches("*bar")).toBe(true); }); it("should only match the provided string", function() { - var specFilter = new j$.HtmlSpecFilter({ + var specFilter = new jasmineUnderTest.HtmlSpecFilter({ filterString: function() { return "foo"; } }); diff --git a/spec/html/MatchersHtmlSpec.js b/spec/html/MatchersHtmlSpec.js index 4fd15600..39660c2b 100644 --- a/spec/html/MatchersHtmlSpec.js +++ b/spec/html/MatchersHtmlSpec.js @@ -2,7 +2,7 @@ describe("MatchersSpec - HTML Dependent", function () { var env, spec; beforeEach(function() { - env = new j$.Env(); + env = new jasmineUnderTest.Env(); var suite = env.describe("suite", function() { spec = env.it("spec", function() { diff --git a/spec/html/PrettyPrintHtmlSpec.js b/spec/html/PrettyPrintHtmlSpec.js index 36dd5c06..336d85f0 100644 --- a/spec/html/PrettyPrintHtmlSpec.js +++ b/spec/html/PrettyPrintHtmlSpec.js @@ -1,15 +1,15 @@ -describe("j$.pp (HTML Dependent)", function () { +describe("jasmineUnderTest.pp (HTML Dependent)", function () { it("should stringify HTML nodes properly", function() { var sampleNode = document.createElement('div'); sampleNode.innerHTML = 'foobar'; - expect(j$.pp(sampleNode)).toEqual("HTMLNode"); - expect(j$.pp({foo: sampleNode})).toEqual("Object({ foo: HTMLNode })"); + expect(jasmineUnderTest.pp(sampleNode)).toEqual("HTMLNode"); + expect(jasmineUnderTest.pp({foo: sampleNode})).toEqual("Object({ foo: HTMLNode })"); }); it("should print Firefox's wrapped native objects correctly", function() { if(jasmine.getEnv().firefoxVersion) { try { new CustomEvent(); } catch(e) { var err = e; }; - expect(j$.pp(err)).toMatch(/Not enough arguments/); + expect(jasmineUnderTest.pp(err)).toMatch(/Not enough arguments/); } }); }); diff --git a/spec/html/QueryStringSpec.js b/spec/html/QueryStringSpec.js index f68261f3..2b9c8cd6 100644 --- a/spec/html/QueryStringSpec.js +++ b/spec/html/QueryStringSpec.js @@ -5,7 +5,7 @@ describe("QueryString", function() { var windowLocation = { search: "" }, - queryString = new j$.QueryString({ + queryString = new jasmineUnderTest.QueryString({ getWindowLocation: function() { return windowLocation } }); @@ -18,7 +18,7 @@ describe("QueryString", function() { var windowLocation = { search: "?foo=bar" }, - queryString = new j$.QueryString({ + queryString = new jasmineUnderTest.QueryString({ getWindowLocation: function() { return windowLocation } }); @@ -34,7 +34,7 @@ describe("QueryString", function() { var windowLocation = { search: "?foo=bar" }, - queryString = new j$.QueryString({ + queryString = new jasmineUnderTest.QueryString({ getWindowLocation: function() { return windowLocation } }); @@ -51,7 +51,7 @@ describe("QueryString", function() { var windowLocation = { search: "?baz=quux%20corge" }, - queryString = new j$.QueryString({ + queryString = new jasmineUnderTest.QueryString({ getWindowLocation: function() { return windowLocation } }); @@ -62,7 +62,7 @@ describe("QueryString", function() { var windowLocation = { search: "" }, - queryString = new j$.QueryString({ + queryString = new jasmineUnderTest.QueryString({ getWindowLocation: function() { return windowLocation } }); diff --git a/spec/html/ResultsNodeSpec.js b/spec/html/ResultsNodeSpec.js index 9cf69274..34ed589d 100644 --- a/spec/html/ResultsNodeSpec.js +++ b/spec/html/ResultsNodeSpec.js @@ -4,7 +4,7 @@ describe("ResultsNode", function() { id: 123, message: "foo" }, - node = new j$.ResultsNode(fakeResult, "suite", null); + node = new jasmineUnderTest.ResultsNode(fakeResult, "suite", null); expect(node.result).toBe(fakeResult); expect(node.type).toEqual("suite"); @@ -19,7 +19,7 @@ describe("ResultsNode", function() { id: 456, message: "bar" }, - node = new j$.ResultsNode(fakeResult, "suite", null); + node = new jasmineUnderTest.ResultsNode(fakeResult, "suite", null); node.addChild(fakeChildResult, "spec"); @@ -37,7 +37,7 @@ describe("ResultsNode", function() { id: 456, message: "bar" }, - node = new j$.ResultsNode(fakeResult, "suite", null); + node = new jasmineUnderTest.ResultsNode(fakeResult, "suite", null); node.addChild(fakeChildResult, "spec"); @@ -53,7 +53,7 @@ describe("ResultsNode", function() { id: 456, message: "bar" }, - node = new j$.ResultsNode(fakeResult, "suite", null); + node = new jasmineUnderTest.ResultsNode(fakeResult, "suite", null); node.addChild(fakeChildResult, "spec"); diff --git a/spec/javascripts/support/jasmine_selenium_runner.yml b/spec/javascripts/support/jasmine_selenium_runner.yml index 73df1395..138dd707 100644 --- a/spec/javascripts/support/jasmine_selenium_runner.yml +++ b/spec/javascripts/support/jasmine_selenium_runner.yml @@ -2,6 +2,7 @@ use_sauce: <%= ENV['USE_SAUCE'] %> browser: <%= ENV['JASMINE_BROWSER'] %> sauce: + sauce_connect_path: "/Users/gregg/Downloads/sc-4.3.11-osx/bin/sc" name: jasmine-core <%= Time.now.to_s %> username: <%= ENV['SAUCE_USERNAME'] %> access_key: <%= ENV['SAUCE_ACCESS_KEY'] %> diff --git a/spec/node_suite.js b/spec/node_suite.js deleted file mode 100644 index 54f09488..00000000 --- a/spec/node_suite.js +++ /dev/null @@ -1,195 +0,0 @@ -var fs = require('fs'); -var util = require('util'); -var path = require('path'); - -// boot code for jasmine -var jasmineRequire = require('../lib/jasmine-core/jasmine.js'); -var jasmine = jasmineRequire.core(jasmineRequire); - -var consoleFns = require('../lib/console/console.js'); -extend(jasmineRequire, consoleFns); -jasmineRequire.console(jasmineRequire, jasmine); - -var env = jasmine.getEnv(); - -var jasmineInterface = { - describe: function(description, specDefinitions) { - return env.describe(description, specDefinitions); - }, - - xdescribe: function(description, specDefinitions) { - return env.xdescribe(description, specDefinitions); - }, - - it: function(desc, func) { - return env.it(desc, func); - }, - - xit: function(desc, func) { - return env.xit(desc, func); - }, - - beforeEach: function(beforeEachFunction) { - return env.beforeEach(beforeEachFunction); - }, - - afterEach: function(afterEachFunction) { - return env.afterEach(afterEachFunction); - }, - - expect: function(actual) { - return env.expect(actual); - }, - - spyOn: function(obj, methodName) { - return env.spyOn(obj, methodName); - }, - - jsApiReporter: new jasmine.JsApiReporter({ - timer: new jasmine.Timer() - }), - - beforeAll: function(beforeAllFunction) { - return env.beforeAll(beforeAllFunction); - }, - - afterAll: function(afterAllFunction) { - return env.afterAll(afterAllFunction); - } -}; - -extend(global, jasmineInterface); - -function extend(destination, source) { - for (var property in source) destination[property] = source[property]; - return destination; -} - -jasmine.addCustomEqualityTester = function(tester) { - env.addCustomEqualityTester(tester); -}; - -jasmine.addMatchers = function(matchers) { - return env.addMatchers(matchers); -}; - -jasmine.clock = function() { - return env.clock; -}; - -// Jasmine "runner" -function executeSpecs(specs, done, isVerbose, showColors) { - global.jasmine = jasmine; - - for (var i = 0; i < specs.length; i++) { - var filename = specs[i]; - require(filename.replace(/\.\w+$/, "")); - } - - var env = jasmine.getEnv(); - var consoleReporter = new jasmine.ConsoleReporter({ - print: util.print, - onComplete: done, - showColors: showColors, - timer: new jasmine.Timer() - }); - - env.addReporter(consoleReporter); - env.execute(); -} - -function getFiles(dir, matcher) { - var allFiles = []; - - if (fs.statSync(dir).isFile() && dir.match(matcher)) { - allFiles.push(dir); - } else { - var files = fs.readdirSync(dir); - for (var i = 0, len = files.length; i < len; ++i) { - var filename = dir + '/' + files[i]; - if (fs.statSync(filename).isFile() && filename.match(matcher)) { - allFiles.push(filename); - } else if (fs.statSync(filename).isDirectory()) { - var subfiles = getFiles(filename); - subfiles.forEach(function(result) { - allFiles.push(result); - }); - } - } - } - return allFiles; -} - -function getSpecFiles(dir) { - return getFiles(dir, new RegExp("Spec.js$")); -} - -var j$require = (function() { - var exported = {}, - j$req; - - global.getJasmineRequireObj = getJasmineRequireObj; - - j$req = require(__dirname + "/../src/core/requireCore.js"); - extend(j$req, require(__dirname + "/../src/console/requireConsole.js")); - - var srcFiles = getFiles(__dirname + "/../src/core"); - srcFiles.push(__dirname + "/../src/version.js"); - srcFiles.push(__dirname + "/../src/console/ConsoleReporter.js"); - - for (var i = 0; i < srcFiles.length; i++) { - require(srcFiles[i]); - } - extend(j$req, exported); - - delete global.getJasmineRequireObj; - - return j$req; - - function getJasmineRequireObj() { - return exported; - } -}()); - -j$ = j$require.core(j$require); -j$require.console(j$require, j$); - -// options from command line -var isVerbose = false; -var showColors = true; -var perfSuite = false; - -process.argv.forEach(function(arg) { - switch (arg) { - case '--color': - showColors = true; - break; - case '--noColor': - showColors = false; - break; - case '--verbose': - isVerbose = true; - break; - case '--perf': - perfSuite = true; - break; - } -}); - -specs = []; - -if (perfSuite) { - specs = getFiles(__dirname + '/performance', new RegExp("test.js$")); -} else { - var consoleSpecs = getSpecFiles(__dirname + "/console"), - coreSpecs = getSpecFiles(__dirname + "/core"), - specs = consoleSpecs.concat(coreSpecs); -} - -executeSpecs(specs, function(passed) { - if (passed) { - process.exit(0); - } else { - process.exit(1); - } -}, isVerbose, showColors); diff --git a/spec/performance/large_object_test.js b/spec/performance/large_object_test.js index 7741decf..4018cae9 100644 --- a/spec/performance/large_object_test.js +++ b/spec/performance/large_object_test.js @@ -30,7 +30,7 @@ describe('Printing a big object', function(){ it('takes a resonable amount of time', function(){ bigObject = generateObject(0); - expect(j$.pp(bigObject)).toMatch(/cycle/); + expect(jasmineUnderTest.pp(bigObject)).toMatch(/cycle/); }); });