summaryrefslogtreecommitdiff
path: root/test/ruby/test_rational.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-13 09:18:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-13 09:18:05 +0000
commit3ac0ec4ecdea849143ed64e8935e6675b341e44b (patch)
treefe18c8213610bfdbca51b687133caf5ab297b882 /test/ruby/test_rational.rb
parent287d2adab0ce45018ada9941ce4eaf67ba6a4d3a (diff)
test/ruby: better assertions
* test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_rational.rb')
-rw-r--r--test/ruby/test_rational.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb
index 0496c0afe3..67f895abc6 100644
--- a/test/ruby/test_rational.rb
+++ b/test/ruby/test_rational.rb
@@ -299,7 +299,7 @@ class Rational_Test < Test::Unit::TestCase
assert_raise(ZeroDivisionError){Rational(1, 3) / Rational(0)}
assert_equal(0, Rational(1, 3) / Float::INFINITY)
- assert((Rational(1, 3) / 0.0).infinite?, '[ruby-core:31626]')
+ assert_predicate(Rational(1, 3) / 0.0, :infinite?, '[ruby-core:31626]')
end
def assert_eql(exp, act, *args)
@@ -550,7 +550,7 @@ class Rational_Test < Test::Unit::TestCase
assert_equal(0.25, c.fdiv(2))
assert_equal(0.25, c.fdiv(2.0))
assert_equal(0, c.fdiv(Float::INFINITY))
- assert(c.fdiv(0).infinite?, '[ruby-core:31626]')
+ assert_predicate(c.fdiv(0), :infinite?, '[ruby-core:31626]')
end
def test_expt
@@ -708,8 +708,8 @@ class Rational_Test < Test::Unit::TestCase
end
def test_eqeq
- assert(Rational(1,1) == Rational(1))
- assert(Rational(-1,1) == Rational(-1))
+ assert_equal(Rational(1,1), Rational(1))
+ assert_equal(Rational(-1,1), Rational(-1))
assert_equal(false, Rational(2,1) == Rational(1))
assert_equal(true, Rational(2,1) != Rational(1))
@@ -830,7 +830,7 @@ class Rational_Test < Test::Unit::TestCase
bug3656 = '[ruby-core:31622]'
c = Rational(1,2)
c.freeze
- assert(c.frozen?)
+ assert_predicate(c, :frozen?)
result = c.marshal_load([2,3]) rescue :fail
assert_equal(:fail, result, bug3656)
end
@@ -1121,7 +1121,7 @@ class Rational_Test < Test::Unit::TestCase
assert_equal(0.5, 1.0.quo(2))
assert_equal(Rational(1,4), Rational(1,2).quo(2))
assert_equal(0, Rational(1,2).quo(Float::INFINITY))
- assert(Rational(1,2).quo(0.0).infinite?, '[ruby-core:31626]')
+ assert_predicate(Rational(1,2).quo(0.0), :infinite?, '[ruby-core:31626]')
assert_equal(0.5, 1.fdiv(2))
assert_equal(5000000000.0, 10000000000.fdiv(2))