spec/integration/image_spec.rb in chunky_png-0.0.1 vs spec/integration/image_spec.rb in chunky_png-0.0.2

- old
+ new

@@ -1,22 +1,15 @@ require File.expand_path('../spec_helper.rb', File.dirname(__FILE__)) -describe ChunkyPNG::Image do - - it "should write a valid PNG image using an indexed palette" do - image = ChunkyPNG::Image.new(10, 20, ChunkyPNG::Color.rgb(10, 100, 255)) - filename = resource_file('testing.png') - File.open(filename, 'w') { |f| image.write(f) } - - png = ChunkyPNG.load(filename) - png.header_chunk.width.should == 10 - png.header_chunk.height.should == 20 - png.header_chunk.color.should == ChunkyPNG::Chunk::Header::COLOR_INDEXED - - png.palette_chunk.should_not be_nil - png.data_chunks.should_not be_empty - # `open #{filename}` - - File.unlink(filename) - end +describe ChunkyPNG do + + # it "should create reference images for all color modes" do + # image = ChunkyPNG::Image.new(10, 10, ChunkyPNG::Pixel.rgb(100, 100, 100)) + # [:indexed, :grayscale, :grayscale_alpha, :truecolor, :truecolor_alpha].each do |color_mode| + # + # color_mode_id = ChunkyPNG::Chunk::Header.const_get("COLOR_#{color_mode.to_s.upcase}") + # filename = resource_file("gray_10x10_#{color_mode}.png") + # File.open(filename, 'w') { |f| image.write(f, :color_mode => color_mode_id) } + # end + # end end