Sha256: 7c43da853f72e7078b26f2583d7e968753e72ad7dcec1fa351e66173d15aa44e

Contents?: true

Size: 817 Bytes

Versions: 1

Compression:

Stored size: 817 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/array/pad.rb
#
# Extracted Fri Feb 16 02:00:37 EST 2007
# Project.rb Test Extraction
#

require 'facets/core/array/pad.rb'


  require 'test/unit'

  class TestPad < Test::Unit::TestCase

    def test_pad
      r = [0,1,2,3].pad(7,"x")
      x = [0,1,2,3,"x","x","x"]
      assert_equal(x,r)
    end

    def test_pad!
      a = [0,1,2,3]
      r = a.pad!(6,"y")
      x = [0,1,2,3,"y","y"]
      assert_equal(x,a)
    end

    def test_pad_negative
      r = [0,1,2,3].pad(-7,"n")
      x = ["n","n","n",0,1,2,3]
      assert_equal(x,r)
    end

    def test_pad_negative!
      a = [0,1,2,3]
      r = a.pad!(-6,"q")
      x = ["q","q",0,1,2,3]
      assert_equal(x,a)
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.8.49 test/lib/facets/core/array/test_pad.rb