Sha256: d7b5aa0634d5d408606509af813136e497cd6231bfd126fad2740775b5899070

Contents?: true

Size: 390 Bytes

Versions: 2

Compression:

Stored size: 390 Bytes

Contents

require 'spec_helper'

describe Randomer::Percent do
  before(:each) do
    @percent_list = {
      :a => 900,
      :b => 1000,
      :c => 870,
      :e => 0,
    }
  end

  it "Pick one by percent list" do
    1000.times do
      result = Randomer::Percent.pick_one @percent_list
      @percent_list.include?(result).should == true
      (result == :e).should == false
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
randomer-0.0.2 spec/randomer_percent_spec.rb
randomer-0.0.1 spec/randomer_percent_spec.rb