Sha256: 2224493a7467f460bae257f1137fb55948209f6427a41b41afec82644bab7603

Contents?: true

Size: 833 Bytes

Versions: 51

Compression:

Stored size: 833 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
  end
end

Version data entries

51 entries across 50 versions & 4 rubygems

Version Path
bench9000-0.1 vendor/chunky_png/spec/chunky_png/image_spec.rb
chunky_png-1.3.1 spec/chunky_png/image_spec.rb
sadui-0.0.4 vendor/bundle/ruby/2.0.0/gems/chunky_png-1.3.0/spec/chunky_png/image_spec.rb
sadui-0.0.4 vendor/bundle/ruby/2.1.0/gems/chunky_png-1.3.0/spec/chunky_png/image_spec.rb
chunky_png-1.3.0 spec/chunky_png/image_spec.rb
chunky_png-1.2.9 spec/chunky_png/image_spec.rb
chunky_png-1.2.8 spec/chunky_png/image_spec.rb
chunky_png-1.2.7 spec/chunky_png/image_spec.rb
chunky_png-1.2.6 spec/chunky_png/image_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/chunky_png-1.2.5/spec/chunky_png/image_spec.rb
chunky_png-1.2.5 spec/chunky_png/image_spec.rb
chunky_png-1.2.4 spec/chunky_png/image_spec.rb
chunky_png-1.2.3 spec/chunky_png/image_spec.rb
chunky_png-1.2.2 spec/chunky_png/image_spec.rb
chunky_png-1.2.1 spec/chunky_png/image_spec.rb
chunky_png-1.2.0 spec/chunky_png/image_spec.rb
chunky_png-1.1.2 spec/chunky_png/image_spec.rb
chunky_png-1.1.1 spec/chunky_png/image_spec.rb
chunky_png-1.1.0 spec/chunky_png/image_spec.rb
chunky_png-1.0.1 spec/chunky_png/image_spec.rb