Sha256: a824eb9a4b3eced2a9c96763633f3ca7f894fa94f45965250d6ed01daa601020

Contents?: true

Size: 602 Bytes

Versions: 12

Compression:

Stored size: 602 Bytes

Contents

require 'spec_helper'

describe ChunkyPNG::Canvas do

  describe '#to_data_url' do
    it "should export a sample canvas to an RGBA stream correctly" do
      canvas = ChunkyPNG::Canvas.new(2, 2, [ChunkyPNG::Color.rgba(1,2,3,4), ChunkyPNG::Color.rgba(5,6,7,8),
                                            ChunkyPNG::Color.rgba(4,3,2,1), ChunkyPNG::Color.rgba(8,7,6,5)])

      expect(canvas.to_data_url).to eql "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACAgMAAAAP2OW3AAAADFBMVEUBAgMEAwIFBgcIBwazgAAdAAAABHRSTlMEAQgFhYDlfQAAAAxJREFUeJxjUmAKAAAAwAB1GNhIEwAAAABJRU5ErkJggg=="
    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_exporting_spec.rb
chunky_png-1.3.10 spec/chunky_png/canvas/data_url_exporting_spec.rb
chunky_png-1.3.9 spec/chunky_png/canvas/data_url_exporting_spec.rb
arcabouco-0.2.13 vendor/bundle/gems/chunky_png-1.3.8/spec/chunky_png/canvas/data_url_exporting_spec.rb
arcabouco-0.2.13 vendor/bundle/gems/chunky_png-1.3.6/spec/chunky_png/canvas/data_url_exporting_spec.rb
chunky_png-1.3.8 spec/chunky_png/canvas/data_url_exporting_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_exporting_spec.rb
chunky_png-1.3.7 spec/chunky_png/canvas/data_url_exporting_spec.rb
chunky_png-1.3.6 spec/chunky_png/canvas/data_url_exporting_spec.rb
chunky_png-1.3.5 spec/chunky_png/canvas/data_url_exporting_spec.rb
chunky_png-1.3.4 spec/chunky_png/canvas/data_url_exporting_spec.rb
chunky_png-1.3.3 spec/chunky_png/canvas/data_url_exporting_spec.rb