Switch to Minitest::Test instead of Test::Unit::TestCase

This gives us a consistent test framework across all Ruby versions which
should help avoid errors that are only found when CI runs the tests on
different Rubies. (And this fixes an immediate bug where there's no
`skip` method in the version of test-unit we're currently using only on
Ruby 2.2.)
This commit is contained in:
Adam Roben
2014-12-31 10:03:15 -05:00
parent c9b7bb73b9
commit 65296e86a3
16 changed files with 27 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
require_relative "./helper"
class TestGenerated < Test::Unit::TestCase
class TestGenerated < Minitest::Test
include Linguist
def samples_path
@@ -11,14 +11,16 @@ class TestGenerated < Test::Unit::TestCase
def generated_without_loading_data(name)
blob = File.join(samples_path, name)
assert_nothing_raised(DataLoadedError, "Data was loaded when calling generated? on #{name}") do
begin
Generated.generated?(blob, lambda { raise DataLoadedError.new })
rescue DataLoadedError
assert false, "Data was loaded when calling generated? on #{name}"
end
end
def generated_loading_data(name)
blob = File.join(samples_path, name)
assert_raise(DataLoadedError, "Data wasn't loaded when calling generated? on #{name}") do
assert_raises(DataLoadedError, "Data wasn't loaded when calling generated? on #{name}") do
Generated.generated?(blob, lambda { raise DataLoadedError.new })
end
end