Sha256: 51ff536206bce844d9371292fc021de920b8a46a12239735be9b18a709a5e69f

Contents?: true

Size: 500 Bytes

Versions: 12

Compression:

Stored size: 500 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
      expect(ChunkyPNG::Canvas.from_data_url(data_url)).to eql reference_canvas('operations')
    end

    it "should raise an exception if the string is not a proper data URL" do
      expect { ChunkyPNG::Canvas.from_data_url('whatever') }.to raise_error(ChunkyPNG::SignatureMismatch)
    end
  end
end

Version data entries

12 entries across 11 versions & 3 rubygems

Version Path
chunky_png-1.3.11 spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.3.10 spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.3.9 spec/chunky_png/canvas/data_url_importing_spec.rb
arcabouco-0.2.13 vendor/bundle/gems/chunky_png-1.3.8/spec/chunky_png/canvas/data_url_importing_spec.rb
arcabouco-0.2.13 vendor/bundle/gems/chunky_png-1.3.6/spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.3.8 spec/chunky_png/canvas/data_url_importing_spec.rb
second_step-0.1.2 secondstep-notify-1.0.0-osx/lib/ruby/lib/ruby/gems/2.2.0/gems/chunky_png-1.3.7/spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.3.7 spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.3.6 spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.3.5 spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.3.4 spec/chunky_png/canvas/data_url_importing_spec.rb
chunky_png-1.3.3 spec/chunky_png/canvas/data_url_importing_spec.rb