Sha256: 316861ac9fa9cc825c3ce4726290516b0028fdad6e9dff821baddf71d3c43908

Contents?: true

Size: 754 Bytes

Versions: 19

Compression:

Stored size: 754 Bytes

Contents

require "spec_helper"

describe Mongoid::Collections::Master do

  let(:collection) do
    stub.quacks_like(Mongo::Collection.allocate)
  end

  let(:db) do
    stub.quacks_like(Mongo::DB.allocate)
  end

  let(:master) do
    Mongoid::Collections::Master.new(db, "people")
  end

  before do
    db.expects(:collection).with("people").returns(collection)
  end

  context "Mongo::Collection operations" do

    Mongoid::Collections::Operations::ALL.each do |name|

      it "defines #{name}" do
        master.should respond_to(name)
      end

      describe "##{name}" do

        before do
          collection.expects(name)
        end

        it "delegates to the collection" do
          master.send(name)
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
mongoid-locomotive-2.0.0.beta9 spec/unit/mongoid/collections/master_spec.rb
mongoid-pre-2.0.0.beta1 spec/unit/mongoid/collections/master_spec.rb
mongoid-2.0.0.alpha spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.14 spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.13 spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.12 spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.11 spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.10 spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.9 spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.8 spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.7 spec/unit/mongoid/collections/master_spec.rb
mongoid-pre-2.0.0.pre spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.6 spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.5 spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.4 spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.3 spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.2 spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.1 spec/unit/mongoid/collections/master_spec.rb
mongoid-1.2.0 spec/unit/mongoid/collections/master_spec.rb