Sha256: d488e51ef44842452b1460de1393aabffe2ec42bb1abbbe0db818bc14efa9a78
Contents?: true
Size: 402 Bytes
Versions: 5
Compression:
Stored size: 402 Bytes
Contents
require "spec_helper" require "hamster/hash" describe Hamster::Hash do describe "#sample" do let(:hash) { Hamster::Hash.new((:a..:z).zip(1..26)) } it "returns a randomly chosen item" do chosen = 250.times.map { hash.sample }.sort.uniq chosen.each { |item| hash.include?(item[0]).should == true } hash.each { |item| chosen.include?(item).should == true } end end end
Version data entries
5 entries across 5 versions & 2 rubygems