Sha256: 75ade3898624a9c2c445cafc880287ee3d1915faeb820c82537a17f4aebc1ca2
Contents?: true
Size: 636 Bytes
Versions: 10
Compression:
Stored size: 636 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') require 'hamster/hash' describe Hamster::Hash do [:has_key?, :key?, :include?, :member?].each do |method| describe "#has_key?" do before do @hash = Hamster.hash("A" => "aye", "B" => "bee", "C" => "see", nil => "NIL") end ["A", "B", "C", nil].each do |key| it "returns true for an existing key (#{key.inspect})" do @hash.send(method, key).should == true end end it "returns false for a non-existing key" do @hash.send(method, "D").should == false end end end end
Version data entries
10 entries across 10 versions & 1 rubygems