Sha256: f200941cbb1955e7a9ae542318b084879eff382227621109a59e2116d5a20866

Contents?: true

Size: 486 Bytes

Versions: 24

Compression:

Stored size: 486 Bytes

Contents

require "spec_helper"

describe Mongoid::Matchers::All do

  let(:matcher) { Mongoid::Matchers::All.new(["first", "second"]) }

  describe "#matches?" do

    context "when the values are equal" do

      it "returns true" do
        matcher.matches?("$all" => ["first", "second"]).should be_true
      end

    end

    context "when the values are not equal" do

      it "returns false" do
        matcher.matches?("$all" => ["first"]).should be_false
      end

    end

  end

end

Version data entries

24 entries across 24 versions & 3 rubygems

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