about summary refs log tree commit homepage
path: root/test
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
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')
-rw-r--r--test/helper.rb3
-rw-r--r--test/test_buffer.rb2
-rw-r--r--test/test_format.rb2
-rw-r--r--test/test_format_change.rb2
-rw-r--r--test/test_player.rb2
-rw-r--r--test/test_player_client_handler.rb2
-rw-r--r--test/test_player_integration.rb2
-rw-r--r--test/test_process.rb2
-rw-r--r--test/test_rg_integration.rb2
-rw-r--r--test/test_rg_state.rb2
-rw-r--r--test/test_sink.rb2
-rw-r--r--test/test_sink_pipe_size.rb2
-rw-r--r--test/test_sink_tee_integration.rb2
-rw-r--r--test/test_source_av.rb2
-rw-r--r--test/test_source_sox.rb2
-rw-r--r--test/test_unixserver.rb2
-rw-r--r--test/test_util.rb2
17 files changed, 19 insertions, 16 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
diff --git a/test/test_buffer.rb b/test/test_buffer.rb
index 259cd4f..677ca62 100644
--- a/test/test_buffer.rb
+++ b/test/test_buffer.rb
@@ -4,7 +4,7 @@ require './test/helper'
 require 'stringio'
 require 'dtas/buffer'
 
-class TestBuffer < Minitest::Unit::TestCase
+class TestBuffer < Testcase
   def teardown
     @to_close.each { |io| io.close unless io.closed? }
   end
diff --git a/test/test_format.rb b/test/test_format.rb
index 0c0b292..f251e6b 100644
--- a/test/test_format.rb
+++ b/test/test_format.rb
@@ -4,7 +4,7 @@ require './test/helper'
 require 'tempfile'
 require 'dtas/format'
 
-class TestFormat < Minitest::Unit::TestCase
+class TestFormat < Testcase
   def test_initialize
     fmt = DTAS::Format.new
     assert_equal %w(-ts32 -c2 -r44100), fmt.to_sox_arg
diff --git a/test/test_format_change.rb b/test/test_format_change.rb
index 99c694a..f840386 100644
--- a/test/test_format_change.rb
+++ b/test/test_format_change.rb
@@ -2,7 +2,7 @@
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
 require './test/player_integration'
 require 'tmpdir'
-class TestFormatChange < Minitest::Unit::TestCase
+class TestFormatChange < Testcase
   include PlayerIntegration
 
   def test_format_change
diff --git a/test/test_player.rb b/test/test_player.rb
index 0fc776a..bc31967 100644
--- a/test/test_player.rb
+++ b/test/test_player.rb
@@ -4,7 +4,7 @@ require './test/helper'
 require 'tempfile'
 require 'dtas/player'
 
-class TestPlayer < Minitest::Unit::TestCase
+class TestPlayer < Testcase
   def setup
     @player = nil
     tmp = Tempfile.new(%w(dtas-player-test .sock))
diff --git a/test/test_player_client_handler.rb b/test/test_player_client_handler.rb
index 9cd84a5..88349bf 100644
--- a/test/test_player_client_handler.rb
+++ b/test/test_player_client_handler.rb
@@ -3,7 +3,7 @@
 require './test/helper'
 require 'dtas/player'
 
-class TestPlayerClientHandler < Minitest::Unit::TestCase
+class TestPlayerClientHandler < Testcase
   class MockIO < Array
     alias emit push
   end
diff --git a/test/test_player_integration.rb b/test/test_player_integration.rb
index e7f7306..f71ed56 100644
--- a/test/test_player_integration.rb
+++ b/test/test_player_integration.rb
@@ -1,7 +1,7 @@
 # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
 require './test/player_integration'
-class TestPlayerIntegration < Minitest::Unit::TestCase
+class TestPlayerIntegration < Testcase
   include PlayerIntegration
 
   def test_cmd_rate
diff --git a/test/test_process.rb b/test/test_process.rb
index 7f7b014..d32cb4a 100644
--- a/test/test_process.rb
+++ b/test/test_process.rb
@@ -2,7 +2,7 @@
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
 require './test/helper'
 require 'dtas/process'
-class TestProcess < Minitest::Unit::TestCase
+class TestProcess < Testcase
   include DTAS::Process
 
   def test_encoding
diff --git a/test/test_rg_integration.rb b/test/test_rg_integration.rb
index 5c570ad..d6a90b0 100644
--- a/test/test_rg_integration.rb
+++ b/test/test_rg_integration.rb
@@ -1,7 +1,7 @@
 # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
 require './test/player_integration'
-class TestRgIntegration < Minitest::Unit::TestCase
+class TestRgIntegration < Testcase
   include PlayerIntegration
 
   def tmp_pluck(len = 5)
diff --git a/test/test_rg_state.rb b/test/test_rg_state.rb
index c79e716..f9642a4 100644
--- a/test/test_rg_state.rb
+++ b/test/test_rg_state.rb
@@ -3,7 +3,7 @@
 require './test/helper'
 require 'dtas/rg_state'
 
-class TestRGState < Minitest::Unit::TestCase
+class TestRGState < Testcase
 
   def test_rg_state
     rg = DTAS::RGState.new
diff --git a/test/test_sink.rb b/test/test_sink.rb
index 2f39d1c..7831727 100644
--- a/test/test_sink.rb
+++ b/test/test_sink.rb
@@ -4,7 +4,7 @@ require './test/helper'
 require 'dtas/sink'
 require 'yaml'
 
-class TestSink < Minitest::Unit::TestCase
+class TestSink < Testcase
   def test_serialize_reload
     sink = DTAS::Sink.new
     sink.name = "DAC"
diff --git a/test/test_sink_pipe_size.rb b/test/test_sink_pipe_size.rb
index 18328df..89001b8 100644
--- a/test/test_sink_pipe_size.rb
+++ b/test/test_sink_pipe_size.rb
@@ -3,7 +3,7 @@
 begin
   require 'io/splice'
   require './test/player_integration'
-  class TestSinkPipeSizeIntegration < Minitest::Unit::TestCase
+  class TestSinkPipeSizeIntegration < Testcase
     include PlayerIntegration
 
     def test_sink_pipe_size_integration
diff --git a/test/test_sink_tee_integration.rb b/test/test_sink_tee_integration.rb
index 1fd6b0f..b186fdd 100644
--- a/test/test_sink_tee_integration.rb
+++ b/test/test_sink_tee_integration.rb
@@ -1,7 +1,7 @@
 # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
 require './test/player_integration'
-class TestSinkTeeIntegration < Minitest::Unit::TestCase
+class TestSinkTeeIntegration < Testcase
   include PlayerIntegration
 
   def test_tee_integration
diff --git a/test/test_source_av.rb b/test/test_source_av.rb
index bc9d1fc..d6dc14f 100644
--- a/test/test_source_av.rb
+++ b/test/test_source_av.rb
@@ -4,7 +4,7 @@ require './test/helper'
 require 'dtas/source/av'
 require 'tempfile'
 
-class TestSourceAv < Minitest::Unit::TestCase
+class TestSourceAv < Testcase
   def teardown
     @tempfiles.each { |tmp| tmp.close! }
   end
diff --git a/test/test_source_sox.rb b/test/test_source_sox.rb
index ce7227b..367f4df 100644
--- a/test/test_source_sox.rb
+++ b/test/test_source_sox.rb
@@ -4,7 +4,7 @@ require './test/helper'
 require 'dtas/source/sox'
 require 'tempfile'
 
-class TestSource < Minitest::Unit::TestCase
+class TestSource < Testcase
   def teardown
     @tempfiles.each { |tmp| tmp.close! }
   end
diff --git a/test/test_unixserver.rb b/test/test_unixserver.rb
index 68fd16b..06ebd96 100644
--- a/test/test_unixserver.rb
+++ b/test/test_unixserver.rb
@@ -5,7 +5,7 @@ require 'tempfile'
 require 'dtas/unix_server'
 require 'stringio'
 
-class TestUNIXServer < Minitest::Unit::TestCase
+class TestUNIXServer < Testcase
   def setup
     @tmp = Tempfile.new(%w(dtas-unix_server-test .sock))
     File.unlink(@tmp.path)
diff --git a/test/test_util.rb b/test/test_util.rb
index e768050..1a592b5 100644
--- a/test/test_util.rb
+++ b/test/test_util.rb
@@ -3,7 +3,7 @@
 require './test/helper'
 require 'dtas/util'
 
-class TestUtil < Minitest::Unit::TestCase
+class TestUtil < Testcase
   include DTAS::Util
   def test_util
     orig = 6.0