Skip to content

Commit bf5ebd0

Browse files
committed
Simplified LOAD_PATH delegation for assert_in_out_err
1 parent 1bbca81 commit bf5ebd0

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

test/bigdecimal/test_bigdecimal.rb

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,11 +1768,7 @@ 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-
# for test-bundled-gems in ruby/ruby repository
1772-
extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":")
1773-
opts = ["-rbigdecimal", "--disable-gems"]
1774-
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
1775-
assert_in_out_err(opts, <<-EOS, expect, [], bug3258)
1771+
assert_in_out_err(["-I#{$LOAD_PATH.join(":")}", "-rbigdecimal", "--disable-gems"], <<-EOS, expect, [], bug3258)
17761772
GC.stress = true
17771773
10.upto(20) do |i|
17781774
p BigDecimal("1"+"0"*i).split
@@ -1781,11 +1777,7 @@ def test_split_under_gc_stress
17811777
end
17821778

17831779
def test_coerce_under_gc_stress
1784-
# for test-bundled-gems in ruby/ruby repository
1785-
extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":")
1786-
opts = ["-rbigdecimal", "--disable-gems"]
1787-
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
1788-
assert_in_out_err(opts, <<-EOS, [], [])
1780+
assert_in_out_err(["-I#{$LOAD_PATH.join(":")}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], [])
17891781
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
17901782
b = BigDecimal("1")
17911783
GC.stress = true
@@ -1892,11 +1884,7 @@ def test_BigMath_exp_with_rational
18921884
end
18931885

18941886
def test_BigMath_exp_under_gc_stress
1895-
# for test-bundled-gems in ruby/ruby repository
1896-
extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":")
1897-
opts = ["-rbigdecimal", "--disable-gems"]
1898-
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
1899-
assert_in_out_err(opts, <<-EOS, [], [])
1887+
assert_in_out_err(["-I#{$LOAD_PATH.join(":")}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], [])
19001888
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
19011889
10.times do
19021890
begin
@@ -2038,11 +2026,7 @@ def test_BigMath_log_with_reciprocal_of_42
20382026
end
20392027

20402028
def test_BigMath_log_under_gc_stress
2041-
# for test-bundled-gems in ruby/ruby repository
2042-
extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":")
2043-
opts = ["-rbigdecimal", "--disable-gems"]
2044-
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
2045-
assert_in_out_err(opts, <<-EOS, [], [])
2029+
assert_in_out_err(["-I#{$LOAD_PATH.join(":")}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], [])
20462030
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
20472031
10.times do
20482032
begin
@@ -2089,11 +2073,7 @@ def test_to_d
20892073
end if RUBY_VERSION < '2.5' # mathn was removed from Ruby 2.5
20902074

20912075
def test_bug6406
2092-
# for test-bundled-gems in ruby/ruby repository
2093-
extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":")
2094-
opts = ["-rbigdecimal", "--disable-gems"]
2095-
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
2096-
assert_in_out_err(opts, <<-EOS, [], [])
2076+
assert_in_out_err(["-I#{$LOAD_PATH.join(":")}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], [])
20972077
Thread.current.keys.to_s
20982078
EOS
20992079
end

0 commit comments

Comments
 (0)