Sha256: c0de1b39f9ac87723e538a61ebcf80b2a6c6727885ae6ef2c1b00992aa2f5815

Contents?: true

Size: 776 Bytes

Versions: 2

Compression:

Stored size: 776 Bytes

Contents

require_relative '../../../spec_helper'
require 'dm-core/support/subject_set'
require_relative 'shared/clear_spec'

describe 'DataMapper::SubjectSet#clear' do
  before :all do

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

  end

  subject { set.clear }

  let(:set)    { DataMapper::SubjectSet.new(entries) }
  let(:entry1) { Person.new('Alice') }
  let(:entry2) { Person.new('Bob'  ) }

  context 'when no entries are present' do
    let(:entries) { [] }

    it_behaves_like 'DataMapper::SubjectSet#clear when no entries are present'
  end

  context 'when entries are present' do
    let(:entries) { [ entry1, entry2 ] }

    it_behaves_like 'DataMapper::SubjectSet#clear when entries are present'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sbf-dm-core-1.3.0 spec/unit/data_mapper/subject_set/clear_spec.rb
sbf-dm-core-1.3.0.beta spec/unit/data_mapper/subject_set/clear_spec.rb