test/test_io.rb in free-image-0.7.1 vs test/test_io.rb in free-image-0.8.0
- old
+ new
@@ -1,10 +1,9 @@
# encoding: UTF-8
require File.join(File.dirname(__FILE__),'test_helper')
-require 'test/unit'
-class IoTest < Test::Unit::TestCase
+class IoTest < Minitest::Test
def io(image = 'sample.png')
path = image_path(image)
file = File.open(path)
FreeImage::IO.new(file)
end
@@ -21,19 +20,19 @@
bitmap = io.open
assert_kind_of(FreeImage::Bitmap, bitmap)
end
def test_load_unknown
- error = assert_raise(FreeImage::Error) do
+ error = assert_raises(FreeImage::Error) do
io('not_an_image.txt').open
end
assert_equal("Cannot load :unknown image format",
error.message)
end
def test_load_wrong_format
- error = assert_raise(FreeImage::Error) do
+ error = assert_raises(FreeImage::Error) do
io.open(:jpeg)
end
assert_equal("Not a JPEG file: starts with 0x89 0x50", error.to_s)
end
@@ -53,21 +52,21 @@
def test_corrupt
path = image_path('corrupt.jpg')
file = File.open(path)
io = FreeImage::IO.new(file)
- error = assert_raise(FreeImage::Error) do
+ error = assert_raises(FreeImage::Error) do
io.open
end
assert_equal("Cannot load :unknown image format", error.message)
end
def test_corrupt_wrong_format
path = image_path('corrupt.jpg')
file = File.open(path)
io = FreeImage::IO.new(file)
- error = assert_raise(FreeImage::Error) do
+ error = assert_raises(FreeImage::Error) do
io.open(:png)
end
assert_equal("Could not load the image", error.message)
end
end
\ No newline at end of file