Skip to content

Commit

Permalink
Use the correct addMatchers interface from core
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregg Van Hove committed Nov 28, 2017
1 parent e0c9d2b commit c3271d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/jasmine.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Jasmine.prototype.configureDefaultReporter = function(options) {
};

Jasmine.prototype.addMatchers = function(matchers) {
this.jasmine.Expectation.addMatchers(matchers);
this.env.addMatchers(matchers);
};

Jasmine.prototype.loadSpecs = function() {
Expand Down
8 changes: 3 additions & 5 deletions spec/jasmine_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ describe('Jasmine', function() {
getEnv: jasmine.createSpy('getEnv').and.returnValue({
addReporter: jasmine.createSpy('addReporter'),
clearReporters: jasmine.createSpy('clearReporters'),
addMatchers: jasmine.createSpy('addMatchers'),
provideFallbackReporter: jasmine.createSpy('provideFallbackReporter'),
execute: jasmine.createSpy('execute'),
throwOnExpectationFailure: jasmine.createSpy('throwOnExpectationFailure'),
randomizeTests: jasmine.createSpy('randomizeTests')
}),
Timer: jasmine.createSpy('Timer'),
Expectation: {
addMatchers: jasmine.createSpy('addMatchers')
}
Timer: jasmine.createSpy('Timer')
};

this.fakeJasmineCore = {
Expand Down Expand Up @@ -157,7 +155,7 @@ describe('Jasmine', function() {

it('adds matchers to the jasmine env', function() {
this.testJasmine.addMatchers(['fake matcher 1', 'fake matcher 2']);
expect(this.bootedJasmine.Expectation.addMatchers).toHaveBeenCalledWith(['fake matcher 1', 'fake matcher 2']);
expect(this.testJasmine.env.addMatchers).toHaveBeenCalledWith(['fake matcher 1', 'fake matcher 2']);
});

describe('loading configurations', function() {
Expand Down

0 comments on commit c3271d2

Please sign in to comment.