mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user