Sha256: ecd5704f956a63fab3c24db2c2eed2143c58937ba4ac233fab735e6ca237ba68
Contents?: true
Size: 978 Bytes
Versions: 1
Compression:
Stored size: 978 Bytes
Contents
require 'spec_helper' describe ChunkyPNG::Image do describe '#metadata' do it "should load metadata from an existing file" do image = ChunkyPNG::Image.from_file(resource_file('text_chunk.png')) image.metadata['Title'].should == 'My amazing icon!' image.metadata['Author'].should == 'Willem van Bergen' end it "should write metadata to the file correctly" do filename = resource_file('_metadata.png') image = ChunkyPNG::Image.new(10, 10) image.metadata['Title'] = 'My amazing icon!' image.metadata['Author'] = 'Willem van Bergen' image.save(filename) metadata = ChunkyPNG::Datastream.from_file(filename).metadata metadata['Title'].should == 'My amazing icon!' metadata['Author'].should == 'Willem van Bergen' end it "should load empty images correctly" do expect do ChunkyPNG::Image.from_file(resource_file('empty.png')) end.to_not raise_error end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
chunky_png-1.3.2 | spec/chunky_png/image_spec.rb |