Sha256: 2ead5b2548f76cf3b183075ff796d4f9ef0b6138c4837ea2f012dd4454610384
Contents?: true
Size: 1.11 KB
Versions: 2
Compression:
Stored size: 1.11 KB
Contents
# encoding: UTF-8 require './test_helper' require 'test/unit' class BitmapTest < Test::Unit::TestCase def test_bits bytes = sample_image.bits assert_equal(6466, bytes.size) if defined?(Encoding) assert_equal(Encoding::BINARY, bytes.encoding) assert_equal(bytes.size, bytes.bytesize) end end def test_open bitmap = FreeImage::Bitmap.open('images/lena.png') assert_kind_of(FreeImage::Bitmap, bitmap) end def test_open_yield result = FreeImage::Bitmap.open('images/lena.png') do |bitmap| assert_kind_of(FreeImage::Bitmap, bitmap) end assert_equal(true, result) end def test_open_yield_error assert_raise(ArgumentError) do FreeImage::Bitmap.open('images/lena.png') do |bitmap| raise(ArgumentError, "Let's mess things up") end end end def test_clone image = lena_image clone = image.clone assert(!clone.equal?(image)) end def test_clone_block lena_image.clone do |image| assert_not_nil(image) end end def test_free 1000.times do image = sample_image image.free end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
free-image-0.6.1 | test/test_bitmap.rb |
free-image-0.6.0 | test/test_bitmap.rb |