require 'minitest/autorun' require 'weighted_selection' class WeightedSelectionTest < MiniTest::Unit::TestCase def test_add_items sel = WeightedSelection::Engine.new sel.add_items([ WeightedSelection::Item.new(50, 'Item 1'), WeightedSelection::Item.new(50, 'Item 2') ]) assert_equal(sel.items.length, 2) end end