fedora-migrator /vendor/gems/facets-2.4.5/test/core/array/test_rotate.rb

Language Ruby Lines 24
MD5 Hash 3ce46ce1272b9078c9029edff6c6bc16 Estimated Cost $352 (why?)
Repository https://bitbucket.org/mediashelf/fedora-migrator View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'facets/array/rotate'
require 'test/unit'

class TC_Array_Rotate < Test::Unit::TestCase

  # rotate

  def test_rotate
    a = [1,2,3]
    assert_equal( [3,1,2], a.rotate, 'clockwise' )
    assert_equal( [2,3,1], a.rotate(-1), 'counter-clockwise' )
  end

  def test_rotate!
    a = [1,2,3]
    a.rotate!
    assert_equal( [3,1,2], a, 'clockwise' )
    a.rotate!(-1)
    assert_equal( [1,2,3], a, 'counter-clockwise' )
  end

end
Back to Top