@@ -1768,7 +1768,8 @@ def test_ctov
17681768 def test_split_under_gc_stress
17691769 bug3258 = '[ruby-dev:41213]'
17701770 expect = 10 . upto ( 20 ) . map { |i |[ 1 , "1" , 10 , i +1 ] . inspect }
1771- assert_in_out_err ( [ "-I#{ $LOAD_PATH. join ( ":" ) } " , "-rbigdecimal" , "--disable-gems" ] , <<-EOS , expect , [ ] , bug3258 )
1771+ paths = $LOAD_PATH. map { |path | "-I#{ path } " }
1772+ assert_in_out_err ( [ *paths , "-rbigdecimal" , "--disable-gems" ] , <<-EOS , expect , [ ] , bug3258 )
17721773 GC.stress = true
17731774 10.upto(20) do |i|
17741775 p BigDecimal("1"+"0"*i).split
@@ -1777,7 +1778,8 @@ def test_split_under_gc_stress
17771778 end
17781779
17791780 def test_coerce_under_gc_stress
1780- assert_in_out_err ( [ "-I#{ $LOAD_PATH. join ( ":" ) } " , "-rbigdecimal" , "--disable-gems" ] , <<-EOS , [ ] , [ ] )
1781+ paths = $LOAD_PATH. map { |path | "-I#{ path } " }
1782+ assert_in_out_err ( [ *paths , "-rbigdecimal" , "--disable-gems" ] , <<-EOS , [ ] , [ ] )
17811783 expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
17821784 b = BigDecimal("1")
17831785 GC.stress = true
@@ -1884,7 +1886,8 @@ def test_BigMath_exp_with_rational
18841886 end
18851887
18861888 def test_BigMath_exp_under_gc_stress
1887- assert_in_out_err ( [ "-I#{ $LOAD_PATH. join ( ":" ) } " , "-rbigdecimal" , "--disable-gems" ] , <<-EOS , [ ] , [ ] )
1889+ paths = $LOAD_PATH. map { |path | "-I#{ path } " }
1890+ assert_in_out_err ( [ *paths , "-rbigdecimal" , "--disable-gems" ] , <<-EOS , [ ] , [ ] )
18881891 expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
18891892 10.times do
18901893 begin
@@ -2026,7 +2029,8 @@ def test_BigMath_log_with_reciprocal_of_42
20262029 end
20272030
20282031 def test_BigMath_log_under_gc_stress
2029- assert_in_out_err ( [ "-I#{ $LOAD_PATH. join ( ":" ) } " , "-rbigdecimal" , "--disable-gems" ] , <<-EOS , [ ] , [ ] )
2032+ paths = $LOAD_PATH. map { |path | "-I#{ path } " }
2033+ assert_in_out_err ( [ *paths , "-rbigdecimal" , "--disable-gems" ] , <<-EOS , [ ] , [ ] )
20302034 expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
20312035 10.times do
20322036 begin
@@ -2073,7 +2077,8 @@ def test_to_d
20732077 end if RUBY_VERSION < '2.5' # mathn was removed from Ruby 2.5
20742078
20752079 def test_bug6406
2076- assert_in_out_err ( [ "-I#{ $LOAD_PATH. join ( ":" ) } " , "-rbigdecimal" , "--disable-gems" ] , <<-EOS , [ ] , [ ] )
2080+ paths = $LOAD_PATH. map { |path | "-I#{ path } " }
2081+ assert_in_out_err ( [ *paths , "-rbigdecimal" , "--disable-gems" ] , <<-EOS , [ ] , [ ] )
20772082 Thread.current.keys.to_s
20782083 EOS
20792084 end
@@ -2283,7 +2288,8 @@ def test_bsearch_for_bigdecimal
22832288
22842289 def assert_no_memory_leak ( code , *rest , **opt )
22852290 code = "8.times {20_000.times {begin #{ code } ; rescue NoMemoryError; end}; GC.start}"
2286- super ( [ "-I#{ $LOAD_PATH. join ( ":" ) } " , "-rbigdecimal" ] ,
2291+ paths = $LOAD_PATH. map { |path | "-I#{ path } " }
2292+ super ( [ *paths , "-rbigdecimal" ] ,
22872293 "b = BigDecimal('10'); b.nil?; " \
22882294 "GC.add_stress_to_class(BigDecimal); " \
22892295 "#{ code } " , code , *rest , rss : true , limit : 1.1 , **opt )
0 commit comments