Sha256: ae94e51df085469b3c8ea60b92b3ba2d14ffd6629fd0200b063822045c224e57

Contents?: true

Size: 993 Bytes

Versions: 26

Compression:

Stored size: 993 Bytes

Contents

require 'spec_helper'

RSpec.describe ActiveFedora::Indexing::Map do
  describe ".merge" do
    subject(:merged) { first_map.merge(extra) }
    let(:index_object1) { instance_double(described_class::IndexObject) }
    let(:index_object2) { instance_double(described_class::IndexObject) }
    let(:index_object3) { instance_double(described_class::IndexObject) }
    let(:first_map) { described_class.new(one: index_object1, two: index_object2) }

    context "with a hash" do
      let(:extra) { { three: index_object3 } }
      it "merges with a hash" do
        expect(merged).to be_instance_of described_class
        expect(merged.keys).to match_array [:one, :two, :three]
      end
    end

    context "with another Indexing::Map" do
      let(:extra) { described_class.new(three: index_object3) }
      it "merges with the other map" do
        expect(merged).to be_instance_of described_class
        expect(merged.keys).to match_array [:one, :two, :three]
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
active-fedora-12.2.4 spec/unit/indexing/map_spec.rb
active-fedora-12.2.3 spec/unit/indexing/map_spec.rb
active-fedora-11.5.6 spec/unit/indexing/map_spec.rb
active-fedora-12.2.2 spec/unit/indexing/map_spec.rb
active-fedora-11.2.1 spec/unit/indexing/map_spec.rb
active-fedora-12.2.1 spec/unit/indexing/map_spec.rb
active-fedora-12.0.3 spec/unit/indexing/map_spec.rb
active-fedora-11.5.5 spec/unit/indexing/map_spec.rb
active-fedora-13.1.2 spec/unit/indexing/map_spec.rb
active-fedora-13.1.1 spec/unit/indexing/map_spec.rb
active-fedora-13.1.0 spec/unit/indexing/map_spec.rb
active-fedora-13.0.0 spec/unit/indexing/map_spec.rb
active-fedora-12.1.1 spec/unit/indexing/map_spec.rb
active-fedora-12.1.0 spec/unit/indexing/map_spec.rb
active-fedora-11.5.4 spec/unit/indexing/map_spec.rb
active-fedora-11.5.3 spec/unit/indexing/map_spec.rb
active-fedora-12.0.2 spec/unit/indexing/map_spec.rb
active-fedora-12.0.1 spec/unit/indexing/map_spec.rb
active-fedora-11.5.2 spec/unit/indexing/map_spec.rb
active-fedora-12.0.0 spec/unit/indexing/map_spec.rb