Sha256: 84f034bb0cde3ca4489eb13bd882207bd17a56a23e5887db7023afbed1c86665
Contents?: true
Size: 982 Bytes
Versions: 3
Compression:
Stored size: 982 Bytes
Contents
require 'rubygems' require 'bundler' Bundler.require(:default, :development) module PNGSuite def png_suite_file(kind, file) File.join(png_suite_dir(kind), file) end def png_suite_dir(kind) File.expand_path("./png_suite/#{kind}", File.dirname(__FILE__)) end def png_suite_files(kind, pattern = '*.png') Dir[File.join(png_suite_dir(kind), pattern)] end end module ResourceFileHelper def resource_file(name) File.expand_path("./resources/#{name}", File.dirname(__FILE__)) 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 def display(canvas) filename = resource_file('_tmp.png') canvas.to_datastream.save(filename) `open #{filename}` end end RSpec.configure do |config| config.extend PNGSuite config.include PNGSuite config.include ResourceFileHelper end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
chunky_png-0.12.0 | spec/spec_helper.rb |
chunky_png-0.11.1 | spec/spec_helper.rb |
chunky_png-0.11.0 | spec/spec_helper.rb |