Skip to content

Commit

Permalink
Testing Stream.drop()
Browse files Browse the repository at this point in the history
  • Loading branch information
Havvy committed Apr 6, 2012
1 parent 217075c commit 5b8c13d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/stream.spec.js
Expand Up @@ -66,6 +66,20 @@ describe('standard functional functions', function () {
.toThrow('Item index does not exist in stream.')
});

it('drops', function () {
oldComment = {};
oldestComment = {};
newComment = {};
newestComment = {};
var comments = Stream.make(oldestComment, oldComment, newComment, newestComment);
var newComments = comments.drop(2);
expect(newComments.length()).toBe(2);
expect(newComments.member(oldComment)).toBeFalsy();
expect(newComments.member(newComment)).toBeTruthy();
expect(newComments.head()).toBe(newComment);
expect(newComments.tail().head()).toBe(newestComment);
})

it('maps', function () {
var alphabet_ascii = Stream.range(97, 122);
var alphabet = alphabet_ascii.map(function (code) {
Expand Down

0 comments on commit 5b8c13d

Please sign in to comment.