[前][次][番号順一覧][スレッド一覧]

ruby-changes:63238

From: Nobuyoshi <ko1@a...>
Date: Thu, 1 Oct 2020 13:53:29 +0900 (JST)
Subject: [ruby-changes:63238] 1d3024da26 (master): Refined assertions for better failure messages

https://git.ruby-lang.org/ruby.git/commit/?id=1d3024da26

From 1d3024da26b2d1c48a04864024a5ed51a8ba3139 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 1 Oct 2020 13:48:15 +0900
Subject: Refined assertions for better failure messages


diff --git a/test/fiber/test_mutex.rb b/test/fiber/test_mutex.rb
index c38d45b..d1fe78c 100644
--- a/test/fiber/test_mutex.rb
+++ b/test/fiber/test_mutex.rb
@@ -11,10 +11,10 @@ class TestFiberMutex < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/fiber/test_mutex.rb#L11
       Thread.current.scheduler = scheduler
 
       Fiber.schedule do
-        refute Thread.current.blocking?
+        assert_not_predicate Thread.current, :blocking?
 
         mutex.synchronize do
-          refute Thread.current.blocking?
+          assert_not_predicate Thread.current, :blocking?
         end
       end
     end
@@ -136,7 +136,7 @@ class TestFiberMutex < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/fiber/test_mutex.rb#L136
 
     thread.join
 
-    assert signalled > 1
+    assert_operator signalled, :>, 1
   end
 
   def test_queue
@@ -167,7 +167,7 @@ class TestFiberMutex < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/fiber/test_mutex.rb#L167
 
     thread.join
 
-    assert processed == 3
+    assert_equal 3, processed
   end
 
   def test_queue_pop_waits
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]