#1015 - revert formatting and spacing

This commit is contained in:
Kevin Logan
2016-02-17 12:09:26 -06:00
parent e5c744f3dc
commit bee8132848

View File

@@ -1,5 +1,4 @@
describe("toHaveBeenCalledTimes", function() { describe("toHaveBeenCalledTimes", function() {
it("passes when the actual 0 matches the expected 0 ", function () { it("passes when the actual 0 matches the expected 0 ", function () {
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(), var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(),
calledSpy = jasmineUnderTest.createSpy('called-spy'), calledSpy = jasmineUnderTest.createSpy('called-spy'),
@@ -14,10 +13,10 @@ describe("toHaveBeenCalledTimes", function () {
calledSpy(); calledSpy();
result = matcher.compare(calledSpy, 1); result = matcher.compare(calledSpy, 1);
expect(result.pass).toBeTruthy(); expect(result.pass).toBe(true);
}); });
it("fails when expected number is not supplied", function () { it("fails when expected numbers is not supplied", function(){
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(), var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(),
spy = jasmineUnderTest.createSpy('spy'), spy = jasmineUnderTest.createSpy('spy'),
result; result;
@@ -25,18 +24,7 @@ describe("toHaveBeenCalledTimes", function () {
spy(); spy();
expect(function() { expect(function() {
matcher.compare(spy); matcher.compare(spy);
}).toThrowError('The expected times failed is a required argument and must be a number.'); }).toThrowError('Expected times failed is required as an argument.');
});
it("fails when expected number is a string", function () {
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(),
spy = jasmineUnderTest.createSpy('spy'),
result;
spy();
expect(function () {
matcher.compare(spy, "1");
}).toThrowError('The expected times failed is a required argument and must be a number.');
}); });
it("fails when the actual was called less than the expected", function() { it("fails when the actual was called less than the expected", function() {
@@ -45,7 +33,7 @@ describe("toHaveBeenCalledTimes", function () {
result; result;
result = matcher.compare(uncalledSpy, 2); result = matcher.compare(uncalledSpy, 2);
expect(result.pass).toBeFalsy(); expect(result.pass).toBe(false);
}); });
it("fails when the actual was called more than expected", function() { it("fails when the actual was called more than expected", function() {
@@ -57,7 +45,7 @@ describe("toHaveBeenCalledTimes", function () {
uncalledSpy(); uncalledSpy();
result = matcher.compare(uncalledSpy, 1); result = matcher.compare(uncalledSpy, 1);
expect(result.pass).toBeFalsy(); expect(result.pass).toBe(false);
}); });
it("throws an exception when the actual is not a spy", function() { it("throws an exception when the actual is not a spy", function() {
@@ -79,7 +67,6 @@ describe("toHaveBeenCalledTimes", function () {
spy(); spy();
result = matcher.compare(spy, 1); result = matcher.compare(spy, 1);
expect(result.message).toEqual('Expected spy sample-spy to have been called once. It was called ' + 4 + ' times.'); expect(result.message).toEqual('Expected spy sample-spy to have been called once. It was called ' + 4 + ' times.');
}); });
@@ -93,7 +80,6 @@ describe("toHaveBeenCalledTimes", function () {
spy(); spy();
result = matcher.compare(spy, 2); result = matcher.compare(spy, 2);
expect(result.message).toEqual('Expected spy sample-spy to have been called 2 times. It was called ' + 4 + ' times.'); expect(result.message).toEqual('Expected spy sample-spy to have been called 2 times. It was called ' + 4 + ' times.');
}); });
/* /*