summaryrefslogtreecommitdiff
path: root/spec/ruby/core/set/subtract_spec.rb
blob: ae4bc73d414ce75363e57b0757d4fe58d71992bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require_relative '../../spec_helper'

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