Sha256: f9b0928b90e67aeb1eb9cc088f00a79243ee11f8657cd431bc7bef82167e4724

Contents?: true

Size: 824 Bytes

Versions: 4

Compression:

Stored size: 824 Bytes

Contents

require_relative '../../../../spec_helper'

shared_examples 'DataMapper::OrderedSet#<< when appending a not yet included entry' do
  its(:size) { is_expected.to eq 2 }
  its(:entries) { is_expected.to include(entry1) }
  its(:entries) { is_expected.to include(entry2) }

  it 'does not alter the position of the existing entry' do
    expect(subject.entries.index(entry1)).to eq @old_index
  end

  it 'appends columns at the end of the set' do
    expect(subject.entries.index(entry2)).to eq @old_index + 1
  end
end

shared_examples 'DataMapper::OrderedSet#<< when updating an already included entry' do
  its(:size) { is_expected.to eq 1 }
  its(:entries) { is_expected.to include(entry2) }

  it 'does not alter the position of the existing entry' do
    expect(subject.entries.index(entry2)).to eq @old_index
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sbf-dm-core-1.5.0 spec/unit/data_mapper/ordered_set/shared/append_spec.rb
sbf-dm-core-1.4.0 spec/unit/data_mapper/ordered_set/shared/append_spec.rb
sbf-dm-core-1.3.0 spec/unit/data_mapper/ordered_set/shared/append_spec.rb
sbf-dm-core-1.3.0.beta spec/unit/data_mapper/ordered_set/shared/append_spec.rb