Sha256: bececd93c9f9a4ff6448659acee24eb6a15a4b763e913076d855ef6486a78134

Contents?: true

Size: 553 Bytes

Versions: 1

Compression:

Stored size: 553 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe Set do
  describe '#pick' do
    it 'should select an element from the Set' do
      set = Set[5,3,1]
      set.should include(set.pick)
    end
  end

  describe '#pop' do
    it 'should remove elements from the Set' do
      total = Set[9,1,8,2,7]

      current = Set[9,1,8,2,7]
      removed = Set[]

      until current.empty?
        removed << current.pop
        total.should == current | removed
        (current & removed).should be_empty
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom_of_choice-1.0.0 spec/axiom_of_choice_spec.rb