提交 1c481be3 编写于 作者: S Santiago Pastorino

Remove blockless_step leave all that up to Ruby

Closes #6297
上级 6e55d30c
require 'active_support/core_ext/range/blockless_step'
require 'active_support/core_ext/range/conversions'
require 'active_support/core_ext/range/include_range'
require 'active_support/core_ext/range/overlaps'
require 'active_support/core_ext/module/aliasing'
class Range
def step_with_blockless(*args, &block) #:nodoc:
if block_given?
step_without_blockless(*args, &block)
else
step_without_blockless(*args).to_a
end
end
alias_method_chain :step, :blockless
end
......@@ -70,7 +70,7 @@ def test_should_include_identical_exclusive_with_floats
end
def test_blockless_step
assert_equal [1,3,5,7,9], (1..10).step(2)
assert_equal [1,3,5,7,9], (1..10).step(2).to_a
end
def test_original_step
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册