Sha256: bb80186bf8452d0905e08f27a9c12139c4a7bed5cefe10728c9ba7c6a67cca39

Contents?: true

Size: 1.31 KB

Versions: 11

Compression:

Stored size: 1.31 KB

Contents

require 'spec_helper'
require 'dm-core/support/ordered_set'
require 'unit/data_mapper/ordered_set/shared/merge_spec'

describe 'DataMapper::OrderedSet#merge' do

  context 'when merging two empty sets' do
    subject { ordered_set.merge([]) }

    let(:ordered_set) { set                        }
    let(:set)         { DataMapper::OrderedSet.new }

    it_should_behave_like 'DataMapper::OrderedSet#merge when merging two empty sets'
  end

  context 'when merging a set with already present entries' do
    subject { ordered_set.merge([ entry ]) }

    let(:ordered_set) { set                                   }
    let(:set)         { DataMapper::OrderedSet.new([ entry ]) }
    let(:entry)       { 1                                     }

    it_should_behave_like 'DataMapper::OrderedSet#merge when merging a set with already present entries'
  end

  context 'when merging a set with not yet present entries' do
    subject { ordered_set.merge([ entry2 ]) }

    let(:ordered_set) { set                                    }
    let(:set)         { DataMapper::OrderedSet.new([ entry1 ]) }
    let(:entry1)      { 1                                      }
    let(:entry2)      { 2                                      }

    it_should_behave_like 'DataMapper::OrderedSet#merge when merging a set with not yet present entries'
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
ardm-core-1.3.0 spec/unit/data_mapper/ordered_set/merge_spec.rb
ardm-core-1.2.1 spec/unit/data_mapper/ordered_set/merge_spec.rb
dm-core-1.2.1 spec/unit/data_mapper/ordered_set/merge_spec.rb
ghost_dm-core-1.3.0.beta spec/unit/data_mapper/ordered_set/merge_spec.rb
dm-core-1.2.0 spec/unit/data_mapper/ordered_set/merge_spec.rb
dm-core-1.2.0.rc2 spec/unit/data_mapper/ordered_set/merge_spec.rb
dm-core-1.2.0.rc1 spec/unit/data_mapper/ordered_set/merge_spec.rb
dm-core-1.1.0 spec/unit/data_mapper/ordered_set/merge_spec.rb
dm-core-1.1.0.rc3 spec/unit/data_mapper/ordered_set/merge_spec.rb
dm-core-1.1.0.rc2 spec/unit/data_mapper/ordered_set/merge_spec.rb
dm-core-1.1.0.rc1 spec/unit/data_mapper/ordered_set/merge_spec.rb