Sha256: 63de0c00eb9cfcf98ea68bd1c5fbdb7759c660d508f2dede91343c7741bdfa3a

Contents?: true

Size: 505 Bytes

Versions: 13

Compression:

Stored size: 505 Bytes

Contents

require 'spec_helper'

describe ChunkyPNG::Canvas do
  
  describe '.from_data_url' do
    it "should import an image from a data URL" do
      data_url = reference_canvas('operations').to_data_url
      ChunkyPNG::Canvas.from_data_url(data_url).should == reference_canvas('operations')
    end
    
    it "should raise an exception if the string is not a proper data URL" do
      lambda { ChunkyPNG::Canvas.from_data_url('whatever') }.should raise_error(ChunkyPNG::SignatureMismatch)
    end
  end
end

Version data entries

13 entries across 12 versions & 4 rubygems

Version Path
bench9000-0.1 vendor/chunky_png/spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.3.2 spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.3.1 spec/chunky_png/canvas/data_url_importing_spec.rb
sadui-0.0.4 vendor/bundle/ruby/2.1.0/gems/chunky_png-1.3.0/spec/chunky_png/canvas/data_url_importing_spec.rb
sadui-0.0.4 vendor/bundle/ruby/2.0.0/gems/chunky_png-1.3.0/spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.3.0 spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.2.9 spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.2.8 spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.2.7 spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.2.6 spec/chunky_png/canvas/data_url_importing_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/chunky_png-1.2.5/spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.2.5 spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.2.4 spec/chunky_png/canvas/data_url_importing_spec.rb