Sha256: 8282f15a934a7e6739205980f6c569ccbb47327dd4bfc06bcac169eef68d4540

Contents?: true

Size: 792 Bytes

Versions: 11

Compression:

Stored size: 792 Bytes

Contents

require 'spec_helper'

shared_examples_for 'DataMapper::OrderedSet#initialize when no entries are given' do
  it { should be_empty }

  its(:entries) { should be_empty }
  its(:size)    { should == 0     }
end

shared_examples_for 'DataMapper::OrderedSet#initialize when entries are given and they do not contain duplicates' do
  it { should_not be_empty    }
  it { should include(entry1) }
  it { should include(entry2) }

  its(:size) { should ==  2 }

  it 'should retain insertion order' do
    subject.index(entry1).should == 0
    subject.index(entry2).should == 1
  end
end

shared_examples_for 'DataMapper::OrderedSet#initialize when entries are given and they contain duplicates' do
  it { should_not be_empty    }
  it { should include(entry1) }

  its(:size) { should ==  1 }
end

Version data entries

11 entries across 11 versions & 3 rubygems

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