about summary refs log tree commit homepage
path: root/test/helper.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-09-06 22:15:52 +0000
committerEric Wong <normalperson@yhbt.net>2013-09-06 22:15:52 +0000
commitf2915737c61854e69b57e388f4dbc36f1aee118d (patch)
tree1d4463c4e17f491c8c69896bb85d7ddc296aeb7b /test/helper.rb
parent610a024097b870afb7ae8c1b9393647e938bea83 (diff)
downloaddtas-f2915737c61854e69b57e388f4dbc36f1aee118d.tar.gz
This is to avoid annoying deprecation warnings in minitest 5, while
still preserving compatibility with minitest 4 (which is distributed
in Ruby 2.0.0 and part of the standard library).
Diffstat (limited to 'test/helper.rb')
-rw-r--r--test/helper.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/helper.rb b/test/helper.rb
index e993463..a36332b 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -46,6 +46,9 @@ gem 'minitest'
 require 'minitest/autorun'
 require "tempfile"
 
+Testcase = Minitest.const_defined?(:Test) ? Minitest::Test
+           : Minitest::Unit::TestCase
+
 FIFOS = []
 at_exit { FIFOS.each { |(pid,path)| File.unlink(path) if $$ == pid } }
 def tmpfifo