From 5cc22740c97bc467f295b1e6c762b6ff0cea4ac3 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sun, 13 May 2018 12:26:56 -0700 Subject: [PATCH] Test the public-ish interface --- spec/core/ExpectationSpec.js | 39 ++++++++++++------------------------ 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/spec/core/ExpectationSpec.js b/spec/core/ExpectationSpec.js index 81668381..e8422a96 100644 --- a/spec/core/ExpectationSpec.js +++ b/spec/core/ExpectationSpec.js @@ -27,14 +27,6 @@ describe("Expectation", function() { expect(expectation.toQuux).toBeDefined(); }); - it("Factory builds an expectation/negative expectation", function() { - var builtExpectation = jasmineUnderTest.Expectation.Factory(); - - expect(builtExpectation instanceof jasmineUnderTest.Expectation).toBe(true); - expect(builtExpectation.not instanceof jasmineUnderTest.Expectation).toBe(true); - expect(builtExpectation.not.isNot).toBe(true); - }); - it("wraps matchers's compare functions, passing in matcher dependencies", function() { var fakeCompare = function() { return { pass: true }; }, matcherFactory = jasmine.createSpy("matcher").and.returnValue({ compare: fakeCompare }), @@ -235,12 +227,11 @@ describe("Expectation", function() { actual = "an actual", expectation; - expectation = new jasmineUnderTest.Expectation({ + expectation = jasmineUnderTest.Expectation.Factory({ customMatchers: matchers, actual: "an actual", - addExpectationResult: addExpectationResult, - isNot: true - }); + addExpectationResult: addExpectationResult + }).not; expectation.toFoo("hello"); @@ -269,13 +260,12 @@ describe("Expectation", function() { actual = "an actual", expectation; - expectation = new jasmineUnderTest.Expectation({ + expectation = jasmineUnderTest.Expectation.Factory({ customMatchers: matchers, actual: "an actual", util: util, addExpectationResult: addExpectationResult, - isNot: true - }); + }).not; expectation.toFoo("hello"); @@ -306,12 +296,11 @@ describe("Expectation", function() { actual = "an actual", expectation; - expectation = new jasmineUnderTest.Expectation({ + expectation = jasmineUnderTest.Expectation.Factory({ customMatchers: matchers, actual: "an actual", - addExpectationResult: addExpectationResult, - isNot: true - }); + addExpectationResult: addExpectationResult + }).not; expectation.toFoo("hello"); @@ -338,12 +327,11 @@ describe("Expectation", function() { actual = "an actual", expectation; - expectation = new jasmineUnderTest.Expectation({ + expectation = jasmineUnderTest.Expectation.Factory({ customMatchers: matchers, actual: "an actual", - addExpectationResult: addExpectationResult, - isNot: true - }); + addExpectationResult: addExpectationResult + }).not; expectation.toFoo("hello"); @@ -375,12 +363,11 @@ describe("Expectation", function() { actual = "an actual", expectation; - expectation = new jasmineUnderTest.Expectation({ + expectation = jasmineUnderTest.Expectation.Factory({ customMatchers: matchers, actual: "an actual", addExpectationResult: addExpectationResult, - isNot: true - }); + }).not; expectation.toFoo("hello");