aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/library/set/subtract_spec.rb
blob: b0889bb675c1a07376a886dc4cf8f2f7aab4ab90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require File.expand_path('../../../spec_helper', __FILE__)
require 'set'

describe "Set#subtract" do
  before :each do
    @set = Set[:a, :b, :c]
  end

  it "deletes any elements contained in other and returns self" do
    @set.subtract(Set[:b, :c]).should == @set
    @set.should == Set[:a]
  end

  it "accepts any enumerable as other" do
    @set.subtract([:c]).should == Set[:a, :b]
  end
end