From 3ac0ec4ecdea849143ed64e8935e6675b341e44b Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 13 Dec 2013 09:18:05 +0000 Subject: 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 --- test/ruby/test_rational.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/ruby/test_rational.rb') 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)) -- cgit v1.2.3