summaryrefslogtreecommitdiff
path: root/test/test_prime.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-25 05:26:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-25 05:26:31 +0000
commit2c3656f5e8c14f2e88e2100eb5e9911b58f94d37 (patch)
tree566e68d6dd667ba2f2bd2814ab097c3b69b1e277 /test/test_prime.rb
parent31637f00fcbaf7c92313e8bf673925b47abaad7f (diff)
test: refine assertions
* test/test_prime.rb (test_eratosthenes_works_fine_after_timeout): use assert_raise to check timeout. * test/test_securerandom.rb: check if results are hexadecimal strings, and refine failure messages. * test/test_tracer.rb (test_tracer_with_option_r_without_gems): use assert_equal to compare. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_prime.rb')
-rw-r--r--test/test_prime.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/test_prime.rb b/test/test_prime.rb
index f6440f861b..1788d71b64 100644
--- a/test/test_prime.rb
+++ b/test/test_prime.rb
@@ -179,10 +179,8 @@ class TestPrime < Test::Unit::TestCase
return n
end
- begin
+ assert_raise(Timeout::Error) do
Timeout.timeout(0.5) { Prime.each(7*37){} }
- flunk("timeout expected")
- rescue Timeout::Error
end
ensure
class << sieve