Update examples for 2.0
This commit is contained in:
@@ -52,7 +52,7 @@ describe("Player", function() {
|
|||||||
|
|
||||||
expect(function() {
|
expect(function() {
|
||||||
player.resume();
|
player.resume();
|
||||||
}).toThrow("song is already playing");
|
}).toThrowError("song is already playing");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
beforeEach(function() {
|
beforeEach(function () {
|
||||||
addMatchers({
|
jasmine.Expectation.addMatchers({
|
||||||
toBePlaying: function(expectedSong) {
|
toBePlaying: function () {
|
||||||
var player = this.actual;
|
return {
|
||||||
return player.currentlyPlayingSong === expectedSong &&
|
compare: function (actual, expected) {
|
||||||
player.isPlaying;
|
var player = actual;
|
||||||
}
|
|
||||||
});
|
return {
|
||||||
|
pass: player.currentlyPlayingSong === expected && player.isPlaying
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user