Sha256: 59cb4ac6b52fc3e1bb2d86900835f4a8b565eb05f0dc03fb44c7144dfb2c05ec

Contents?: true

Size: 882 Bytes

Versions: 2

Compression:

Stored size: 882 Bytes

Contents

require_relative '../../../spec_helper'
require 'dm-core/support/ordered_set'
require_relative 'shared/size_spec'

describe 'DataMapper::OrderedSet#size' do
  subject { ordered_set.size }

  context 'when no entry is present' do
    let(:ordered_set) { DataMapper::OrderedSet.new }

    it_behaves_like 'DataMapper::OrderedSet#size when no entry is present'
  end

  context 'when 1 entry is present' do
    let(:ordered_set) { DataMapper::OrderedSet.new([ 1 ]) }

    it_behaves_like 'DataMapper::OrderedSet#size when 1 entry is present'
  end

  context 'when more than 1 entry is present' do
    let(:ordered_set)   { DataMapper::OrderedSet.new(entries) }
    let(:entries)       { [ 1, 2 ]                            }
    let(:expected_size) { entries.size                        }

    it_behaves_like 'DataMapper::OrderedSet#size when more than 1 entry is 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/ordered_set/size_spec.rb
sbf-dm-core-1.3.0.beta spec/unit/data_mapper/ordered_set/size_spec.rb