mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Remove unused enum_with_index helper
This commit is contained in:
parent
f9cddb64ce
commit
eae963fc7b
2 changed files with 0 additions and 13 deletions
|
@ -332,14 +332,6 @@ MSG
|
|||
klass.send("#{attr}s").include?(ruby1_8? ? method.to_s : method.to_sym)
|
||||
end
|
||||
|
||||
# A version of `Enumerable#enum_with_index` that works in Ruby 1.8 and 1.9.
|
||||
#
|
||||
# @param enum [Enumerable] The enumerable to get the enumerator for
|
||||
# @return [Enumerator] The with-index enumerator
|
||||
def enum_with_index(enum)
|
||||
ruby1_8? ? enum.enum_with_index : enum.each_with_index
|
||||
end
|
||||
|
||||
# A version of `Enumerable#enum_cons` that works in Ruby 1.8 and 1.9.
|
||||
#
|
||||
# @param enum [Enumerable] The enumerable to get the enumerator for
|
||||
|
|
|
@ -48,11 +48,6 @@ class UtilTest < MiniTest::Unit::TestCase
|
|||
assert(has?(:private_instance_method, Haml::Engine, :set_locals))
|
||||
end
|
||||
|
||||
def test_enum_with_index
|
||||
assert_equal(%w[foo0 bar1 baz2],
|
||||
enum_with_index(%w[foo bar baz]).map {|s, i| "#{s}#{i}"})
|
||||
end
|
||||
|
||||
def test_enum_cons
|
||||
assert_equal(%w[foobar barbaz],
|
||||
enum_cons(%w[foo bar baz], 2).map {|s1, s2| "#{s1}#{s2}"})
|
||||
|
|
Loading…
Add table
Reference in a new issue