Sha256: ce8e6164118d5e4152a1c5d40ad602958bbf91dd147ca395e5911498e636a076

Contents?: true

Size: 624 Bytes

Versions: 3

Compression:

Stored size: 624 Bytes

Contents

require "spec_helper"

describe Mongoid::Extensions::Set do

  describe "#demongoize" do

    it "returns the set if Array" do
      Set.demongoize([ "test" ]).should eq(Set.new([ "test" ]))
    end
  end

  describe ".mongoize" do

    it "returns an array" do
      Set.mongoize([ "test" ]).should eq([ "test" ])
    end

    it "returns an array even if the value is a set" do
      Set.mongoize(Set.new([ "test" ])).should eq([ "test" ])
    end
  end

  describe "#mongoize" do

    let(:set) do
      Set.new([ "test" ])
    end

    it "returns an array" do
      set.mongoize.should eq([ "test" ])
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongoid-3.1.7 spec/mongoid/extensions/set_spec.rb
mongoid-3.1.6 spec/mongoid/extensions/set_spec.rb
mongoid-3.1.5 spec/mongoid/extensions/set_spec.rb