File: construction_spec.rb

package info (click to toggle)
ruby-immutable-ruby 0.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,852 kB
  • sloc: ruby: 16,556; makefile: 4
file content (18 lines) | stat: -rw-r--r-- 432 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'spec_helper'

describe Immutable::Set do
  describe '.set' do
    context 'with no values' do
      it 'returns the empty set' do
        S.empty.should be_empty
        S.empty.should equal(Immutable::EmptySet)
      end
    end

    context 'with a list of values' do
      it 'is equivalent to repeatedly using #add' do
        S['A', 'B', 'C'].should eql(S.empty.add('A').add('B').add('C'))
      end
    end
  end
end