From f2915737c61854e69b57e388f4dbc36f1aee118d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 6 Sep 2013 22:15:52 +0000 Subject: test/*: compatibility class for both minitest 4 and 5 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). --- test/helper.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/helper.rb') 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 -- cgit v1.2.3-24-ge0c7