diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-10 08:39:51 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-10 08:39:51 +0000 |
commit | a05bfd49410bedb5812f8f4e4c27eb1bcd15211e (patch) | |
tree | 320ba867c027f02340d63b01ee078b33ee78d6b4 /test | |
parent | 5287eb7453f481dd1fed7b8561cd0b57771afaa9 (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_2@55362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_process.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 459e0a5050..4dadfb49d1 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -2041,4 +2041,22 @@ EOS status = th.value assert status.success?, status.inspect end if defined?(fork) + + 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 |