ruby-tdb user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [PATCH] test/test_tdb_mt.rb: fix fragile test
@ 2018-04-29 21:59 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2018-04-29 21:59 UTC (permalink / raw)
  To: ruby-tdb-public; +Cc: Eric Wong

Method#inspect has changed in modern Ruby, so try to make test
less fragile.
---
 test/test_tdb_mt.rb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/test_tdb_mt.rb b/test/test_tdb_mt.rb
index 781e2bd..7f8611c 100644
--- a/test/test_tdb_mt.rb
+++ b/test/test_tdb_mt.rb
@@ -90,7 +90,10 @@ class Test_TDB_MT < Test::Unit::TestCase
     @tdb = TDB.new(nil)
     respond_to?(:refute_match) and
       m.each { |meth| refute_match(/\bTDB::MT\b/, @tdb.method(meth).to_s) }
+    before = m.map { |meth| [ meth, @tdb.method(meth).to_s ] }
     @tdb.threadsafe!
-    m.each { |meth| assert_match(/\bTDB::MT\b/, @tdb.method(meth).to_s) }
+    before.each do |(meth, old)|
+      refute_equal old, @tdb.method(meth).to_s
+    end
   end
 end
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-29 21:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-29 21:59 [PATCH] test/test_tdb_mt.rb: fix fragile test Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/ruby-tdb.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).