Sha256: 088b6b23eb8977fa563fec3e91a5e1d0d663aceb2d34d6a4615980bcc0f409b7

Contents?: true

Size: 505 Bytes

Versions: 4

Compression:

Stored size: 505 Bytes

Contents

covers 'facets/array/pad'

testcase Array do

  unit :pad do
    r = [0,1,2,3].pad(7,"x")
    x = [0,1,2,3,"x","x","x"]
    r.assert == x
  end

  unit :pad! do
    a = [0,1,2,3]
    r = a.pad!(6,"y")
    x = [0,1,2,3,"y","y"]
    r.assert == x
  end

  unit :pad => "negative index" do
    r = [0,1,2,3].pad(-7,"n")
    x = ["n","n","n",0,1,2,3]
    r.assert == x
  end

  unit :pad! => "negative index" do
    a = [0,1,2,3]
    r = a.pad!(-6,"q")
    x = ["q","q",0,1,2,3]
    r.assert == x
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facets-2.9.1 test/core/array/test_pad.rb
facets-2.9.0 test/core/array/test_pad.rb
facets-2.9.0.pre.2 test/core/array/test_pad.rb
facets-2.9.0.pre.1 test/core/array/test_pad.rb