Sha256: e7bd3677754a4e7f17167788e292f73b0042d3080bc5b5a8c45810ee01dfa52a
Contents?: true
Size: 681 Bytes
Versions: 3
Compression:
Stored size: 681 Bytes
Contents
require "spec_helper" require "hamster/set" describe Hamster::Set do describe "#compact" do [ [[], []], [["A"], ["A"]], [%w[A B C], %w[A B C]], [[nil], []], [[nil, "B"], ["B"]], [["A", nil], ["A"]], [[nil, nil], []], [["A", nil, "C"], %w[A C]], [[nil, "B", nil], ["B"]], ].each do |values, expected| describe "on #{values.inspect}" do let(:set) { S[*values] } it "preserves the original" do set.compact set.should eql(S[*values]) end it "returns #{expected.inspect}" do set.compact.should eql(S[*expected]) end end end end end
Version data entries
3 entries across 3 versions & 2 rubygems