summaryrefslogtreecommitdiff
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-13 18:23:45 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-13 18:23:45 +0000
commit84b8954d0d2badac8d05ccdef8939dc210031273 (patch)
treeba3b6d51f49667fb9c86daf5710eb2e1ad54ad2c /test/ruby/test_process.rb
parent85ca853a50ca3678b1fb6cef54d015a69380a39e (diff)
merge revision(s) 54934: [Backport #12355]
* process.c (rb_exec_getargs): honor the expected argument types over the conversion method. the basic language functionality should be robust. [ruby-core:75388] [Bug #12355] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r--test/ruby/test_process.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 8d6274adf3..28617b60b4 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -2256,4 +2256,22 @@ EOS
system(bin, "--disable=gems", "-w", "-e", "puts ARGV", *args)
end;
end
+
+ def test_to_hash_on_arguments
+ all_assertions do |a|
+ %w[Array String].each do |type|
+ a.for(type) do
+ assert_separately(['-', EnvUtil.rubybin], <<~"END;")
+ class #{type}
+ def to_hash
+ raise "[Bug-12355]: #{type}#to_hash is called"
+ end
+ end
+ ex = ARGV[0]
+ assert_equal(true, system([ex, ex], "-e", ""))
+ END;
+ end
+ end
+ end
+ end
end