Sha256: 3bdd72b514b2f339d172113c5d5f6d81737780d02dfb213a4f8d1287e02802bd

Contents?: true

Size: 599 Bytes

Versions: 15

Compression:

Stored size: 599 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)])

      canvas.to_data_url.should == "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACAgMAAAAP2OW3AAAADFBMVEUBAgMEAwIFBgcIBwazgAAdAAAABHRSTlMEAQgFhYDlfQAAAAxJREFUeJxjUmAKAAAAwAB1GNhIEwAAAABJRU5ErkJggg=="
    end
  end
end

Version data entries

15 entries across 14 versions & 4 rubygems

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