require 'test/unit' require 'util/array_alternatives' class UTestArrayAlternatives < Test::Unit::TestCase def test_01_normal_use first, second, third = [1], [2], [3, 4] a = first / second / third alts = a.assemble_alternatives assert_kind_of(Array, alts) assert_equal(3, alts.length) assert_equal(first, alts[0]) assert_equal(second, alts[1]) assert_equal(third, alts[2]) end def test_02_without_any_alternatives a = [1] alts = a.assemble_alternatives assert_kind_of(Array, alts) assert_equal(1, alts.length) assert_equal(a, alts[0]) end end