Sha256: da4ace65d17453c21ddc61d9266a2606784581ac311050250afc08d4e37cdfc7

Contents?: true

Size: 780 Bytes

Versions: 27

Compression:

Stored size: 780 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe Set do

  describe ".evolve" do

    context "when provided a set" do

      let(:set) do
        ::Set.new([ 1, 2, 3 ])
      end

      it "returns an array" do
        expect(described_class.evolve(set)).to eq([ 1, 2, 3 ])
      end
    end

    context "when provided an array" do

      it "returns an array" do
        expect(described_class.evolve([ 1, 2, 3 ])).to eq([ 1, 2, 3 ])
      end
    end

    context "when provided another object" do

      it "returns the object" do
        expect(described_class.evolve("testing")).to eq("testing")
      end
    end

    context "when provided nil" do

      it "returns nil" do
        expect(described_class.evolve(nil)).to be_nil
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
mongoid-8.1.9 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.0.9 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.1.8 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.1.7 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.1.6 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.0.8 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.1.5 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.1.4 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.0.7 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.1.3 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.1.2 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.0.6 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-7.5.4 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.1.1 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.0.5 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.1.0 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-7.5.3 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.0.4 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-8.0.3 spec/mongoid/criteria/queryable/extensions/set_spec.rb
mongoid-7.5.2 spec/mongoid/criteria/queryable/extensions/set_spec.rb