summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_file.rb28
-rw-r--r--test/ruby/test_io.rb4
-rw-r--r--test/ruby/test_keyword.rb4
-rw-r--r--test/ruby/test_optimization.rb2
-rw-r--r--test/ruby/test_thread.rb4
-rw-r--r--test/ruby/test_thread_queue.rb2
6 files changed, 22 insertions, 22 deletions
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb
index 3deab76e93c..ecca8d3e356 100644
--- a/test/ruby/test_file.rb
+++ b/test/ruby/test_file.rb
@@ -147,8 +147,8 @@ class TestFile < Test::Unit::TestCase
end
def test_read_all_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- Tempfile.create("test-extended-file", mode) {|f|
+ [{}, {:textmode=>true}, {:binmode=>true}].each do |mode|
+ Tempfile.create("test-extended-file", **mode) {|f|
assert_nil(f.getc)
f.print "a"
f.rewind
@@ -158,8 +158,8 @@ class TestFile < Test::Unit::TestCase
end
def test_gets_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- Tempfile.create("test-extended-file", mode) {|f|
+ [{}, {:textmode=>true}, {:binmode=>true}].each do |mode|
+ Tempfile.create("test-extended-file", **mode) {|f|
assert_nil(f.getc)
f.print "a"
f.rewind
@@ -169,8 +169,8 @@ class TestFile < Test::Unit::TestCase
end
def test_gets_para_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- Tempfile.create("test-extended-file", mode) {|f|
+ [{}, {:textmode=>true}, {:binmode=>true}].each do |mode|
+ Tempfile.create("test-extended-file", **mode) {|f|
assert_nil(f.getc)
f.print "\na"
f.rewind
@@ -180,8 +180,8 @@ class TestFile < Test::Unit::TestCase
end
def test_each_char_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- Tempfile.create("test-extended-file", mode) {|f|
+ [{}, {:textmode=>true}, {:binmode=>true}].each do |mode|
+ Tempfile.create("test-extended-file", **mode) {|f|
assert_nil(f.getc)
f.print "a"
f.rewind
@@ -193,8 +193,8 @@ class TestFile < Test::Unit::TestCase
end
def test_each_byte_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- Tempfile.create("test-extended-file", mode) {|f|
+ [{}, {:textmode=>true}, {:binmode=>true}].each do |mode|
+ Tempfile.create("test-extended-file", **mode) {|f|
assert_nil(f.getc)
f.print "a"
f.rewind
@@ -206,8 +206,8 @@ class TestFile < Test::Unit::TestCase
end
def test_getc_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- Tempfile.create("test-extended-file", mode) {|f|
+ [{}, {:textmode=>true}, {:binmode=>true}].each do |mode|
+ Tempfile.create("test-extended-file", **mode) {|f|
assert_nil(f.getc)
f.print "a"
f.rewind
@@ -217,8 +217,8 @@ class TestFile < Test::Unit::TestCase
end
def test_getbyte_extended_file
- [nil, {:textmode=>true}, {:binmode=>true}].each do |mode|
- Tempfile.create("test-extended-file", mode) {|f|
+ [{}, {:textmode=>true}, {:binmode=>true}].each do |mode|
+ Tempfile.create("test-extended-file", **mode) {|f|
assert_nil(f.getc)
f.print "a"
f.rewind
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index b47db4f3c22..7849d81fd00 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1395,7 +1395,7 @@ class TestIO < Test::Unit::TestCase
def test_dup_many
opts = {}
opts[:rlimit_nofile] = 1024 if defined?(Process::RLIMIT_NOFILE)
- assert_separately([], <<-'End', opts)
+ assert_separately([], <<-'End', **opts)
a = []
assert_raise(Errno::EMFILE, Errno::ENFILE, Errno::ENOMEM) do
loop {a << IO.pipe}
@@ -3644,7 +3644,7 @@ __END__
def test_race_gets_and_close
opt = { signal: :ABRT, timeout: 200 }
- assert_separately([], "#{<<-"begin;"}\n#{<<-"end;"}", opt)
+ assert_separately([], "#{<<-"begin;"}\n#{<<-"end;"}", **opt)
bug13076 = '[ruby-core:78845] [Bug #13076]'
begin;
10.times do |i|
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb
index eda74276e24..ad90acfb0ab 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -254,8 +254,8 @@ class TestKeywordArguments < Test::Unit::TestCase
[:keyrest, :kw], [:block, :b]], p6.parameters)
end
- def m1(*args)
- yield(*args)
+ def m1(*args, **options)
+ yield(*args, **options)
end
def test_block
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
index a39260afc40..ed779fe5a85 100644
--- a/test/ruby/test_optimization.rb
+++ b/test/ruby/test_optimization.rb
@@ -398,7 +398,7 @@ class TestRubyOptimization < Test::Unit::TestCase
foo
end;1
end;
- status, _err = EnvUtil.invoke_ruby([], "", true, true, {}) {
+ status, _err = EnvUtil.invoke_ruby([], "", true, true, **{}) {
|in_p, out_p, err_p, pid|
in_p.write(script)
in_p.close
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 3283e30122a..e0efb7b2e0b 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -961,7 +961,7 @@ _eom
cmd = 'Signal.trap(:INT, "DEFAULT"); pipe=IO.pipe; Thread.start {Thread.pass until Thread.main.stop?; puts; STDOUT.flush}; pipe[0].read'
opt = {}
opt[:new_pgroup] = true if /mswin|mingw/ =~ RUBY_PLATFORM
- s, t, _err = EnvUtil.invoke_ruby(['-e', cmd], "", true, true, opt) do |in_p, out_p, err_p, cpid|
+ s, t, _err = EnvUtil.invoke_ruby(['-e', cmd], "", true, true, **opt) do |in_p, out_p, err_p, cpid|
assert IO.select([out_p], nil, nil, 10), 'subprocess not ready'
out_p.gets
pid = cpid
@@ -1337,7 +1337,7 @@ q.pop
# prevent SIGABRT from slow shutdown with MJIT
opts[:reprieve] = 3 if RubyVM::MJIT.enabled?
- assert_normal_exit(<<-_end, '[Bug #8996]', opts)
+ assert_normal_exit(<<-_end, '[Bug #8996]', **opts)
Thread.report_on_exception = false
trap(:TERM){exit}
while true
diff --git a/test/ruby/test_thread_queue.rb b/test/ruby/test_thread_queue.rb
index e96107cea71..e46f0b2e8e0 100644
--- a/test/ruby/test_thread_queue.rb
+++ b/test/ruby/test_thread_queue.rb
@@ -134,7 +134,7 @@ class TestThreadQueue < Test::Unit::TestCase
timeout = 60
total_count = 250
begin
- assert_normal_exit(<<-"_eom", bug5343, {:timeout => timeout, :chdir=>d})
+ assert_normal_exit(<<-"_eom", bug5343, **{:timeout => timeout, :chdir=>d})
#{total_count}.times do |i|
open("test_thr_kill_count", "w") {|f| f.puts i }
queue = Queue.new