Sha256: 66307fa6d18de2ce47bcf8064ea64df6bccb372488366eaf561f996ecc55be5f

Contents?: true

Size: 885 Bytes

Versions: 11

Compression:

Stored size: 885 Bytes

Contents

require 'spec_helper'
require 'dm-core/support/subject_set'
require 'unit/data_mapper/subject_set/shared/get_spec'

describe 'DataMapper::SubjectSet#[]' do
  before :all do

    class ::Person
      attr_reader :name
      def initialize(name)
        @name = name
      end
    end

  end

  subject { set[name] }

  let(:set  ) { DataMapper::SubjectSet.new(entries) }
  let(:entry) { Person.new(name)                    }
  let(:name ) { 'Alice'                             }

  context 'when the entry with the given name is not present' do
    let(:entries) { [] }

    it_should_behave_like 'DataMapper::SubjectSet#[] when the entry with the given name is not present'
  end

  context 'when the entry with the given name is present' do
    let(:entries) { [ entry ] }

    it_should_behave_like 'DataMapper::SubjectSet#[] when the entry with the given name is present'
  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/get_spec.rb
ardm-core-1.2.1 spec/unit/data_mapper/subject_set/get_spec.rb
dm-core-1.2.1 spec/unit/data_mapper/subject_set/get_spec.rb
ghost_dm-core-1.3.0.beta spec/unit/data_mapper/subject_set/get_spec.rb
dm-core-1.2.0 spec/unit/data_mapper/subject_set/get_spec.rb
dm-core-1.2.0.rc2 spec/unit/data_mapper/subject_set/get_spec.rb
dm-core-1.2.0.rc1 spec/unit/data_mapper/subject_set/get_spec.rb
dm-core-1.1.0 spec/unit/data_mapper/subject_set/get_spec.rb
dm-core-1.1.0.rc3 spec/unit/data_mapper/subject_set/get_spec.rb
dm-core-1.1.0.rc2 spec/unit/data_mapper/subject_set/get_spec.rb
dm-core-1.1.0.rc1 spec/unit/data_mapper/subject_set/get_spec.rb