Sha256: 7347d024e505d62052cb1a054af709a2fabd0721077ae55ccff390673c950bc1

Contents?: true

Size: 1.45 KB

Versions: 11

Compression:

Stored size: 1.45 KB

Contents

require 'spec_helper'

shared_examples_for 'DataMapper::SubjectSet#values_at when one name is given and no entry with the given name is present' do
  its(:size) { should == given_names.size }

  it 'should contain nil values for the names not found' do
    subject.compact.should be_empty
  end
end

shared_examples_for 'DataMapper::SubjectSet#values_at when one name is given and an entry with the given name is present' do
  its(:size) { should == given_names.size }

  it { should include(entry1) }
end

shared_examples_for 'DataMapper::SubjectSet#values_at when more than one name is given and no entry with any of the given names is present' do
  its(:size) { should == given_names.size }

  it 'should contain nil values for the names not found' do
    subject.compact.should be_empty
  end
end

shared_examples_for 'DataMapper::SubjectSet#values_at when more than one name is given and one entry with one of the given names is present' do
  it { should include(entry1) }

  its(:size) { should == given_names.size }

  it 'should contain nil values for the names not found' do
    subject.compact.size.should == 1
  end
end

shared_examples_for 'DataMapper::SubjectSet#values_at when more than one name is given and an entry for every given name is present' do
  it { should include(entry1) }
  it { should include(entry2) }

  its(:size) { should == given_names.size }

  it 'should not contain any nil values' do
    subject.compact.size.should == given_names.size
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

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