Sha256: e98810330d24a8a429f5a837bae8bb7d8e282148a77bedf60189b19559309c02
Contents?: true
Size: 706 Bytes
Versions: 29
Compression:
Stored size: 706 Bytes
Contents
describe "Hash#include?" do it "returns true if the argument is a key" do h = {:a => 1, :b => 2, :c => 3, 4 => 0} h.include?(:a).should == true h.include?(:b).should == true h.include?(:B).should == false h.include?(2).should == false h.include?(4).should == true h.include?(42).should == false end it "returns true if the key's matching value was nil" do {:xyz => nil}.include?(:xyz).should == true end it "returns true if the key's matching value was false" do {:xyz => false}.include?(:xyz).should == true end it "returns true if the key is nil" do {nil => 'b'}.include?(nil).should == true {nil => nil}.include?(nil).should == true end end
Version data entries
29 entries across 29 versions & 1 rubygems