Skip to content

Commit

Permalink
tests: switch to Minitest 5
Browse files Browse the repository at this point in the history
Update the test suite to use the new Minitest 5 framework API. Remove
the last references to Test::Unit and standardize on "Minitest"
everywhere.
  • Loading branch information
ktdreyer committed Jul 11, 2014
1 parent 380dd2e commit 9df3bea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion mono_logger.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ Gem::Specification.new do |spec|

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
spec.add_development_dependency "minitest", "~> 4.0"
spec.add_development_dependency "minitest", "~> 5.0"
end
14 changes: 6 additions & 8 deletions test/mri_logger_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
require 'coveralls'
Coveralls.wear!

require 'test/unit'
require 'minitest/autorun'
require 'mono_logger'
require 'tempfile'

Logger = MonoLogger


class TestLoggerSeverity < Test::Unit::TestCase
class TestLoggerSeverity < Minitest::Test
def test_enum
logger_levels = Logger.constants
levels = ["WARN", "UNKNOWN", "INFO", "FATAL", "DEBUG", "ERROR"]
Expand All @@ -29,7 +29,7 @@ def test_enum
end


class TestLogger < Test::Unit::TestCase
class TestLogger < Minitest::Test
include Logger::Severity

def setup
Expand Down Expand Up @@ -270,7 +270,7 @@ def test_lshift
end
end

class TestLogDevice < Test::Unit::TestCase
class TestLogDevice < Minitest::Test
class LogExcnRaiser
def write(*arg)
raise 'disk is full'
Expand Down Expand Up @@ -344,9 +344,7 @@ class << (stderr = '')
end
$stderr, stderr = stderr, $stderr
begin
assert_nothing_raised do
logdev.write('hello')
end
logdev.write('hello')
ensure
logdev.close
$stderr, stderr = stderr, $stderr
Expand Down Expand Up @@ -491,7 +489,7 @@ def test_shifting_age
end


class TestLoggerApplication < Test::Unit::TestCase
class TestLoggerApplication < Minitest::Test
def setup
@app = Logger::Application.new('appname')
@tempfile = Tempfile.new("logger")
Expand Down

0 comments on commit 9df3bea

Please sign in to comment.