Sha256: c8e056a56086532fe7812d51a765852d180f31c5669c3ec320e5e4f6804d2edd

Contents?: true

Size: 571 Bytes

Versions: 2

Compression:

Stored size: 571 Bytes

Contents

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

require 'rubygems'
require 'spec'

require 'chunky_png'

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


module MatrixDisplayingHelper
  def display(matrix)
    image = ChunkyPNG::Image.from_pixel_matrix(matrix)
    filename = resource_file('_tmp.png')
    image.save(filename)
    `open #{filename}`
  end
end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chunky_png-0.0.5 spec/spec_helper.rb
chunky_png-0.0.4 spec/spec_helper.rb