Sha256: 443230ae78f9f00393f1aaba0a2491c8dadd1383ca95c21912adccd0319dc5e3

Contents?: true

Size: 600 Bytes

Versions: 1

Compression:

Stored size: 600 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper.rb'

class Win32screenshotTest < Test::Unit::TestCase

  def test_should_create_bmp
    width, height, bmp = Win32::Screenshot.foreground
    assert_equal 1280, width
    assert_equal 720,  height
    assert_equal 'BM',  bmp[0..1]
  end
  
  def test_should_be_convertible_to_png
    require 'rubygems'
    require 'RMagick'

    width, height, bmp = Win32::Screenshot.foreground
    img = Magick::Image.from_blob(bmp)
    png = img[0].to_blob do
      self.format = 'PNG'
    end
    assert_equal "\211PNG",  png[0..3]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
win32screenshot-0.0.1 test/win32screenshot_test.rb