Sha256: eaf9c14399c33a94d7f2790ab0341fb9a717af7810812dccd2fc7bcf2a9f2b81
Contents?: true
Size: 861 Bytes
Versions: 83
Compression:
Stored size: 861 Bytes
Contents
describe :enumerable_include, :shared => true do it "returns true if any element == argument" do class EnumerableSpecIncludeP; def ==(obj) obj == 5; end; end elements = (0..5).to_a EnumerableSpecs::Numerous.new(*elements).send(@method,5).should == true EnumerableSpecs::Numerous.new(*elements).send(@method,10).should == false EnumerableSpecs::Numerous.new(*elements).send(@method,EnumerableSpecIncludeP.new).should == true end it "returns true if any member of enum equals obj when == compare different classes (legacy rubycon)" do # equality is tested with == EnumerableSpecs::Numerous.new(2,4,6,8,10).send(@method, 2.0).should == true EnumerableSpecs::Numerous.new(2,4,[6,8],10).send(@method, [6, 8]).should == true EnumerableSpecs::Numerous.new(2,4,[6,8],10).send(@method, [6.0, 8.0]).should == true end end
Version data entries
83 entries across 83 versions & 1 rubygems