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