提交 c8f1aac7 编写于 作者: X Xavier Noria 提交者: wycats

restricts a test to < 1.9, and rewrites it using a proper expectation

Signed-off-by: Nwycats <wycats@gmail.com>
上级 4ba334c0
......@@ -180,17 +180,11 @@ def test_reload_returns_assocition
end
end
def test_splat_does_not_invoke_to_a_on_singular_targets
Kernel.module_eval do
alias original_to_a to_a
def to_a
[:_]
end
end
assert_not_equal [:_], [*posts(:welcome).author]
ensure
Kernel.module_eval do
alias to_a original_to_a
if RUBY_VERSION < '1.9'
def test_splat_does_not_invoke_to_a_on_singular_targets
author = posts(:welcome).author
author.reload.target.expects(:to_a).never
[*author]
end
end
......
......@@ -7,6 +7,7 @@
require 'test/unit'
require 'stringio'
require 'mocha'
require 'active_record'
require 'active_support/dependencies'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册