diff --git a/lib/jasmine-core/example/spec/PlayerSpec.js b/lib/jasmine-core/example/spec/PlayerSpec.js index 79f10221..f17521fd 100644 --- a/lib/jasmine-core/example/spec/PlayerSpec.js +++ b/lib/jasmine-core/example/spec/PlayerSpec.js @@ -52,7 +52,7 @@ describe("Player", function() { expect(function() { player.resume(); - }).toThrow("song is already playing"); + }).toThrowError("song is already playing"); }); }); -}); \ No newline at end of file +}); diff --git a/lib/jasmine-core/example/spec/SpecHelper.js b/lib/jasmine-core/example/spec/SpecHelper.js index c097ee1f..415c5438 100644 --- a/lib/jasmine-core/example/spec/SpecHelper.js +++ b/lib/jasmine-core/example/spec/SpecHelper.js @@ -1,9 +1,15 @@ -beforeEach(function() { - addMatchers({ - toBePlaying: function(expectedSong) { - var player = this.actual; - return player.currentlyPlayingSong === expectedSong && - player.isPlaying; - } - }); +beforeEach(function () { + jasmine.Expectation.addMatchers({ + toBePlaying: function () { + return { + compare: function (actual, expected) { + var player = actual; + + return { + pass: player.currentlyPlayingSong === expected && player.isPlaying + } + } + }; + } + }); });