Sha256: 0629a2a38a6cf96c50292bc804b484c658bab68c214d4c99ae51da537dc047cb
Contents?: true
Size: 754 Bytes
Versions: 13
Compression:
Stored size: 754 Bytes
Contents
class LifeUniverseAndEverything def include?(obj) obj == 42 end end describe 'array' do describe "in?" do it "should support arrays" do 1.in?([1,2,3]).should == true 0.in?([1,2,3]).should == false end it "should support hashes" do :a.in?({a:1,b:2,c:3}).should == true 1.in?({a:1,b:2,c:3}).should == false end it "should support ranges" do 1.in?(1..3).should == true 0.in?(1..3).should == false end it "should support strings" do 'a'.in?("apple").should == true end it "should support anything that implements `include?`" do 42.in?(LifeUniverseAndEverything.new).should == true 0.in?(LifeUniverseAndEverything.new).should == false end end end
Version data entries
13 entries across 13 versions & 2 rubygems