1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Remove strip_string_array - dead code

This commit is contained in:
Norman Clarke 2012-05-22 16:36:56 -03:00
parent 45ffb09b09
commit d7985dd9fd
2 changed files with 0 additions and 21 deletions

View file

@ -106,18 +106,6 @@ module Haml
end end
end end
# Destructively strips whitespace from the beginning and end
# of the first and last elements, respectively,
# in the array (if those elements are strings).
#
# @param arr [Array]
# @return [Array] `arr`
def strip_string_array(arr)
arr.first.lstrip! if arr.first.is_a?(String)
arr.last.rstrip! if arr.last.is_a?(String)
arr
end
# Return an array of all possible paths through the given arrays. # Return an array of all possible paths through the given arrays.
# #
# @param arrs [Array<Array>] # @param arrs [Array<Array>]

View file

@ -65,15 +65,6 @@ class UtilTest < MiniTest::Unit::TestCase
powerset([1, 2, 3])) powerset([1, 2, 3]))
end end
def test_strip_string_array
assert_equal(["foo ", " bar ", " baz"],
strip_string_array([" foo ", " bar ", " baz "]))
assert_equal([:foo, " bar ", " baz"],
strip_string_array([:foo, " bar ", " baz "]))
assert_equal(["foo ", " bar ", :baz],
strip_string_array([" foo ", " bar ", :baz]))
end
def test_paths def test_paths
assert_equal([[1, 3, 5], [2, 3, 5], [1, 4, 5], [2, 4, 5]], assert_equal([[1, 3, 5], [2, 3, 5], [1, 4, 5], [2, 4, 5]],
paths([[1, 2], [3, 4], [5]])) paths([[1, 2], [3, 4], [5]]))