Sha256: 9c6f6fc238db0e7273a5d5fb1b206e2b5686ba28d2aea12933cffb474e33b99b
Contents?: true
Size: 858 Bytes
Versions: 12
Compression:
Stored size: 858 Bytes
Contents
require File.expand_path('../../../spec_helper', __FILE__) require 'hamster/set' describe Hamster::Set do describe "#subset?" do [ [[], [], true], [["A"], [], false], [[], ["A"], true], [["A"], ["A"], true], [["A", "B", "C"], ["B"], false], [["B"], ["A", "B", "C"], true], [["A", "B", "C"], ["A", "C"], false], [["A", "C"], ["A", "B", "C"], true], [["A", "B", "C"], ["A", "B", "C"], true], [["A", "B", "C"], ["A", "B", "C", "D"], true], [["A", "B", "C", "D"], ["A", "B", "C"], false], ].each do |a, b, expected| describe "for #{a.inspect} and #{b.inspect}" do before do @result = Hamster.set(*a).subset?(Hamster.set(*b)) end it "returns #{expected}" do @result.should == expected end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems