Sha256: ea574731bceb9c0695eb70e8ba487880b7a50fdb7f76b969ce29f7cc24d8c050

Contents?: true

Size: 750 Bytes

Versions: 5

Compression:

Stored size: 750 Bytes

Contents

$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'rubygems'
require 'bundler'

Bundler.setup

require 'spec'
require 'chunky_png'

module ResourceFileHelper
  def resource_file(name)
    File.expand_path("./resources/#{name}", File.dirname(__FILE__))
  end
end


module MatrixSpecHelper
  def display(canvas)
    filename = resource_file('_tmp.png')
    canvas.to_datastream.save(filename)
    `open #{filename}`
  end
  
  def reference_canvas(name)
    ChunkyPNG::Canvas.from_file(resource_file("#{name}.png"))
  end
  
  def reference_image(name)
    ChunkyPNG::Image.from_file(resource_file("#{name}.png"))
  end
end

Spec::Runner.configure do |config|
  config.include ResourceFileHelper
  config.include MatrixSpecHelper
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chunky_png-0.10.3 spec/spec_helper.rb
chunky_png-0.10.2 spec/spec_helper.rb
chunky_png-0.10.1 spec/spec_helper.rb
chunky_png-0.10.0 spec/spec_helper.rb
chunky_png-0.9.2 spec/spec_helper.rb