Skip to content

Commit

Permalink
Test that the list of spies contained in a stub instance is dotted ou…
Browse files Browse the repository at this point in the history
…t when it would exceed the available horizontal space.
  • Loading branch information
papandreou committed Jan 25, 2017
1 parent b5297d5 commit 080d009
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/unexpected-sinon.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,26 @@ describe('unexpected-sinon', function () {
"foo( 123 ); at theFunction (theFileName:xx:yy)"
);
});

it('should dot out the list of contained spies when they exceed expect.output.preferredWidth', function () {
expect.output.preferredWidth = 45;
var stubInstance = sinon.createStubInstance(MyClass);
stubInstance.foo(123);
stubInstance.bar(456);
stubInstance.foo(123);
return expect(function () {
return expect(stubInstance, 'to have no calls satisfying', function () {
stubInstance.bar(456);
});
}, 'to error with',
"expected MyClass({foo /* 1 more */})\n" +
"to have no calls satisfying bar( 456 );\n" +
"\n" +
"foo( 123 ); at theFunction (theFileName:xx:yy)\n" +
"bar( 456 ); at theFunction (theFileName:xx:yy) // should be removed\n" +
"foo( 123 ); at theFunction (theFileName:xx:yy)"
);
});
});

describe('when passed a spec object', function () {
Expand Down

0 comments on commit 080d009

Please sign in to comment.