Skip to content

Commit

Permalink
small fix to test/mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Kifer committed Dec 15, 2010
1 parent a12e253 commit 5440cbb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/mongo.coffee
Expand Up @@ -46,11 +46,23 @@ runner.mettle ->
else
@db.find 'Food', { }, { limit: 10 }, (error, foods) =>
assert.equal foods.length, 10
@db.find_one 'Food', { }, { skip: 10 }, (error, food) =>
@db.find_one 'Food', { }, { skip: 10, sort: { number: -1 } }, (error, food) =>
assert.equal food.number, 90
@next()
insert()

# runner.mettle ->
# @tell 'find with limit/skip'
# for i in [1..100]
# @db.queue 'insert', 'Food', { name: 'Apple', type: 'Fruit', number: i }
# @db.flush()
# @db.on 'flush', =>
# @db.find 'Food', { }, { limit: 10 }, (error, foods) =>
# assert.equal foods.length, 10
# @db.find_one 'Food', { }, { skip: 10 }, (error, food) =>
# assert.equal food.number, 90
# @next()

runner.mettle ->
@tell 'find with fields'
@db.find_one 'Food', { }, { fields: [ 'name' ] }, (error, food) =>
Expand Down

0 comments on commit 5440cbb

Please sign in to comment.