summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/openssl/test_pair.rb2
-rw-r--r--test/ruby/test_econv.rb4
-rw-r--r--test/ruby/test_settracefunc.rb2
-rw-r--r--test/thread/test_queue.rb2
4 files changed, 5 insertions, 5 deletions
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb
index 932426572f..33ec555492 100644
--- a/test/openssl/test_pair.rb
+++ b/test/openssl/test_pair.rb
@@ -49,7 +49,7 @@ module OpenSSL::SSLPairM
return c, s
end
ensure
- if th && th.alive?
+ if th&.alive?
th.kill
th.join
end
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb
index 073355f319..5690ec75f2 100644
--- a/test/ruby/test_econv.rb
+++ b/test/ruby/test_econv.rb
@@ -18,8 +18,8 @@ class TestEncodingConverter < Test::Unit::TestCase
def assert_errinfo(e_res, e_enc1, e_enc2, e_error_bytes, e_readagain_bytes, ec)
assert_equal([e_res, e_enc1, e_enc2,
- e_error_bytes && e_error_bytes.b,
- e_readagain_bytes && e_readagain_bytes.b],
+ e_error_bytes&.b,
+ e_readagain_bytes&.b],
ec.primitive_errinfo)
end
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb
index ef5a0c0620..e5048adba1 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -464,7 +464,7 @@ class TestSetTraceFunc < Test::Unit::TestCase
EOF
self.class.class_eval{remove_const(:XYZZY)}
ensure
- trace.disable if trace && trace.enabled?
+ trace.disable if trace&.enabled?
end
answer_events = [
diff --git a/test/thread/test_queue.rb b/test/thread/test_queue.rb
index 59d51e730c..7ab6d1e01e 100644
--- a/test/thread/test_queue.rb
+++ b/test/thread/test_queue.rb
@@ -427,7 +427,7 @@ class TestQueue < Test::Unit::TestCase
# wait for all threads to be finished, because of exceptions
# NOTE: thr.status will be nil (raised) or false (terminated)
- sleep 0.01 until prod_threads && prod_threads.all?{|thr| !thr.status}
+ sleep 0.01 until prod_threads&.all?{|thr| !thr.status}
# check that all threads failed to call push
prod_threads.each do |thr|