spec/image_spec.rb in psd-1.1.1 vs spec/image_spec.rb in psd-1.2.0
- old
+ new
@@ -14,26 +14,24 @@
@psd.parse!
expect(@psd).to be_parsed
expect(@psd.image).to_not be_nil
expect(@psd.image.width).to eq(1)
expect(@psd.image.height).to eq(1)
- expect(@psd.image.pixel_data).to eq([0, 100, 200, 255])
+ expect(@psd.image.pixel_data).to eq([ChunkyPNG::Color.rgba(0, 100, 200, 255)])
end
it "should be able to skip to the image" do
expect(@psd).to_not be_parsed
expect(@psd.image.width).to eq(1)
expect(@psd.image.height).to eq(1)
- expect(@psd.image.pixel_data).to eq([0, 100, 200, 255])
+ expect(@psd.image.pixel_data).to eq([ChunkyPNG::Color.rgba(0, 100, 200, 255)])
end
describe "as PNG" do
it "should produce a valid PNG object" do
expect(@psd.image.to_png).to be_an_instance_of(ChunkyPNG::Image)
- # Ensure it's cached
- expect(@psd.image.to_png).to be @psd.image.to_png
expect(@psd.image.to_png.width).to eq(1)
expect(@psd.image.to_png.height).to eq(1)
expect(
ChunkyPNG::Color.to_truecolor_alpha_bytes(@psd.image.to_png[0,0])
).to eq([0, 100, 200, 255])
@@ -49,10 +47,10 @@
image = @psd.tree.children.first.image
expect(image).to be_an_instance_of(PSD::ChannelImage)
expect(image.width).to eq(1)
expect(image.height).to eq(1)
- expect(image.pixel_data).to eq([0, 100, 200, 255])
+ expect(image.pixel_data).to eq([ChunkyPNG::Color.rgba(0, 100, 200, 255)])
end
describe "as PNG" do
it "should produce a valid PNG object" do
@psd.options[:parse_layer_images] = true
\ No newline at end of file