Skip to content

Commit 84646b8

Browse files
authored
Don't use assert_separatly if not needed (#455)
1 parent 3e1f0ec commit 84646b8

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

test/bigdecimal/test_bigdecimal.rb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -786,15 +786,14 @@ def test_precs_deprecated
786786
end
787787

788788
def test_precs
789-
assert_separately(["-rbigdecimal"], "#{<<~"begin;"}\n#{<<~'end;'}")
790-
begin;
791-
$VERBOSE = nil
792-
a = BigDecimal("1").precs
793-
assert_instance_of(Array, a)
794-
assert_equal(2, a.size)
795-
assert_kind_of(Integer, a[0])
796-
assert_kind_of(Integer, a[1])
797-
end;
789+
$VERBOSE, verbose = nil, $VERBOSE
790+
a = BigDecimal("1").precs
791+
assert_instance_of(Array, a)
792+
assert_equal(2, a.size)
793+
assert_kind_of(Integer, a[0])
794+
assert_kind_of(Integer, a[1])
795+
ensure
796+
$VERBOSE = verbose
798797
end
799798

800799
def test_hash

test/bigdecimal/test_bigmath.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,16 +400,14 @@ def test_log
400400
assert_converge_in_precision {|n| log(BigDecimal("1e30"), n) }
401401
assert_converge_in_precision {|n| log(SQRT2, n) }
402402
assert_raise(Math::DomainError) {log(BigDecimal("-0.1"), 10)}
403-
assert_separately(%w[-rbigdecimal], <<-SRC)
404403
begin
405-
x = BigMath.log(BigDecimal("1E19999999999999"), 10)
404+
x = BigDecimal("1E19999999999999")
406405
rescue FloatDomainError
407406
else
408407
unless x.infinite?
409-
assert_in_epsilon(Math.log(10)*19999999999999, x)
408+
assert_in_epsilon(Math.log(10) * 19999999999999, BigMath.log(x, 10))
410409
end
411410
end
412-
SRC
413411
end
414412

415413
def test_log2

0 commit comments

Comments
 (0)