items = require("../build/liblol.js").items

describe "items", ->

  describe "find", ->

    it "should return all items when nothing is passed to it", ->
      items.find().should.include item for item in items.list

    it "should throw an error if the parameters are bad", ->
      try
        items.find "blah"
      catch e
        e.message.should.equal "Condition is not a function!"

items = require("../build/liblol.js").items

describe "items", ->

  describe "find", ->

    it "should return all items when nothing is passed to it", ->
      items.find().should.include item for item in items.list

    it "should throw an error if the condition isn't a function", ->
      try
        items.find "blah"
      catch e
        e.message.should.equal "Condition is not a function!"

    it "should return a blank array if the condition is never true", ->
      items.find(-> false).should.eql []

Add test for blank array
Add test for blank array

Signed-off-by: Ian Macalinao <08370e385f4778cad8fe504ec5445edd3d45bd9a@gmail.com>
