Test the public-ish interface

This commit is contained in:
Steve Gravrock
2018-05-13 12:26:56 -07:00
parent 533bda5d24
commit 5cc22740c9
+13 -26
View File
@@ -27,14 +27,6 @@ describe("Expectation", function() {
expect(expectation.toQuux).toBeDefined(); 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() { it("wraps matchers's compare functions, passing in matcher dependencies", function() {
var fakeCompare = function() { return { pass: true }; }, var fakeCompare = function() { return { pass: true }; },
matcherFactory = jasmine.createSpy("matcher").and.returnValue({ compare: fakeCompare }), matcherFactory = jasmine.createSpy("matcher").and.returnValue({ compare: fakeCompare }),
@@ -235,12 +227,11 @@ describe("Expectation", function() {
actual = "an actual", actual = "an actual",
expectation; expectation;
expectation = new jasmineUnderTest.Expectation({ expectation = jasmineUnderTest.Expectation.Factory({
customMatchers: matchers, customMatchers: matchers,
actual: "an actual", actual: "an actual",
addExpectationResult: addExpectationResult, addExpectationResult: addExpectationResult
isNot: true }).not;
});
expectation.toFoo("hello"); expectation.toFoo("hello");
@@ -269,13 +260,12 @@ describe("Expectation", function() {
actual = "an actual", actual = "an actual",
expectation; expectation;
expectation = new jasmineUnderTest.Expectation({ expectation = jasmineUnderTest.Expectation.Factory({
customMatchers: matchers, customMatchers: matchers,
actual: "an actual", actual: "an actual",
util: util, util: util,
addExpectationResult: addExpectationResult, addExpectationResult: addExpectationResult,
isNot: true }).not;
});
expectation.toFoo("hello"); expectation.toFoo("hello");
@@ -306,12 +296,11 @@ describe("Expectation", function() {
actual = "an actual", actual = "an actual",
expectation; expectation;
expectation = new jasmineUnderTest.Expectation({ expectation = jasmineUnderTest.Expectation.Factory({
customMatchers: matchers, customMatchers: matchers,
actual: "an actual", actual: "an actual",
addExpectationResult: addExpectationResult, addExpectationResult: addExpectationResult
isNot: true }).not;
});
expectation.toFoo("hello"); expectation.toFoo("hello");
@@ -338,12 +327,11 @@ describe("Expectation", function() {
actual = "an actual", actual = "an actual",
expectation; expectation;
expectation = new jasmineUnderTest.Expectation({ expectation = jasmineUnderTest.Expectation.Factory({
customMatchers: matchers, customMatchers: matchers,
actual: "an actual", actual: "an actual",
addExpectationResult: addExpectationResult, addExpectationResult: addExpectationResult
isNot: true }).not;
});
expectation.toFoo("hello"); expectation.toFoo("hello");
@@ -375,12 +363,11 @@ describe("Expectation", function() {
actual = "an actual", actual = "an actual",
expectation; expectation;
expectation = new jasmineUnderTest.Expectation({ expectation = jasmineUnderTest.Expectation.Factory({
customMatchers: matchers, customMatchers: matchers,
actual: "an actual", actual: "an actual",
addExpectationResult: addExpectationResult, addExpectationResult: addExpectationResult,
isNot: true }).not;
});
expectation.toFoo("hello"); expectation.toFoo("hello");