Sha256: 5a6ae0b84fea62f66028a553bfa87e9e5f599163e8632af1c406e908d8bbf68a

Contents?: true

Size: 469 Bytes

Versions: 1

Compression:

Stored size: 469 Bytes

Contents

# -*- coding: utf-8 -*-
require 'minitest/autorun'
require 'sixarm_ruby_ramp/array/shuffle'

class ArrayTest < Minitest::Test

  def test_shuffle
    a=[1,2,3,4]
    5.times {
      b=a.shuffle
      assert_equal(a.size,b.size)
      a.each{|item| assert(b.include?(item)) }
    }
  end

  def test_shuffle_bang
    a=[1,2,3,4]
    b=a.dup
    5.times {
      b.shuffle!
      assert_equal(a.size,b.size)
      a.each{|item| assert(b.include?(item)) }
    }
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sixarm_ruby_ramp-4.2.2 test/sixarm_ruby_ramp_test/array/shuffle_test.rb