Sha256: 151c5165ba3ad0eda0c7c8a37550742371a449718506780155cb7e9cffe5c1d0

Contents?: true

Size: 481 Bytes

Versions: 3

Compression:

Stored size: 481 Bytes

Contents

require "spec_helper"

describe Mongoid::Matchers::Size do

  let(:matcher) do
    described_class.new(["first", "second"])
  end

  describe "#matches?" do

    context "when the attribute is the same size" do

      it "returns true" do
        matcher.matches?("$size" => 2).should be_true
      end
    end

    context "when the attribute is not the same size" do

      it "returns false" do
        matcher.matches?("$size" => 5).should be_false
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongoid-3.1.7 spec/mongoid/matchers/size_spec.rb
mongoid-3.1.6 spec/mongoid/matchers/size_spec.rb
mongoid-3.1.5 spec/mongoid/matchers/size_spec.rb