Sha256: 0134239b675e3bbb5098bc902b4b72dcdba743c2c707740e7dabb87c90aa15f6

Contents?: true

Size: 585 Bytes

Versions: 28

Compression:

Stored size: 585 Bytes

Contents

require 'spec_helper'

describe Mongoid::FakeCriteria do

  context "with the books ['book 1', 'book 2', 'book 3', 'book 4']" do
    let(:books) { Mongoid::FakeCriteria.new(['book 1', 'book 2', 'book 3', 'book 4']) }

    describe "#limit" do
      the ("books.limit(2).raw") { should eql ['book 1', 'book 2'] }
      the ("books.limit(0).raw") { should eql ['book 1', 'book 2', 'book 3', 'book 4'] }
      the ("books.limit(6).raw") { should eql ['book 1', 'book 2', 'book 3', 'book 4'] }
    end

    context "#count" do
      the ("books.count") { should eql 4 }
    end
  end

end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
ants-0.2.0 spec/mongoid/fake_criteria_spec.rb
ants-0.1.4 spec/mongoid/fake_criteria_spec.rb
ants-0.1.1 spec/mongoid/fake_criteria_spec.rb
ants-0.1.0 spec/mongoid/fake_criteria_spec.rb
mongoid-sorted-relations-0.0.4 spec/mongoid/fake_criteria_spec.rb
mongoid-sorted-relations-0.0.3 spec/mongoid/fake_criteria_spec.rb
mongoid-sorted-relations-0.0.2 spec/mongoid/fake_criteria_spec.rb
mongoid-sorted-relations-0.0.1 spec/mongoid/fake_criteria_spec.rb