Sha256: 126658bd2e36aae1273d60829deffc8e19ee329f0df6569554a8e5d3df95e541

Contents?: true

Size: 1 KB

Versions: 12

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe ChunkyPNG::Canvas do

  describe '.from_rgb_stream' do
    it "should load an image correctly from a datastream" do
      File.open(resource_file('pixelstream.rgb')) do |stream|
        matrix = ChunkyPNG::Canvas.from_rgb_stream(240, 180, stream)
        expect(matrix).to eql reference_canvas('pixelstream_reference')
      end
    end
  end

  describe '.from_bgr_stream' do
    it "should load an image correctly from a datastream" do
      File.open(resource_file('pixelstream.bgr')) do |stream|
        matrix = ChunkyPNG::Canvas.from_bgr_stream(240, 180, stream)
        expect(matrix).to eql reference_canvas('pixelstream_reference')
      end
    end
  end

  describe '.from_rgba_stream' do
    it "should load an image correctly from a datastream" do
      File.open(resource_file('pixelstream.rgba')) do |stream|
        matrix = ChunkyPNG::Canvas.from_rgba_stream(240, 180, stream)
        expect(matrix).to eql reference_canvas('pixelstream_reference')
      end
    end
  end
end

Version data entries

12 entries across 11 versions & 3 rubygems

Version Path
chunky_png-1.3.11 spec/chunky_png/canvas/stream_importing_spec.rb
chunky_png-1.3.10 spec/chunky_png/canvas/stream_importing_spec.rb
chunky_png-1.3.9 spec/chunky_png/canvas/stream_importing_spec.rb
arcabouco-0.2.13 vendor/bundle/gems/chunky_png-1.3.8/spec/chunky_png/canvas/stream_importing_spec.rb
arcabouco-0.2.13 vendor/bundle/gems/chunky_png-1.3.6/spec/chunky_png/canvas/stream_importing_spec.rb
chunky_png-1.3.8 spec/chunky_png/canvas/stream_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/stream_importing_spec.rb
chunky_png-1.3.7 spec/chunky_png/canvas/stream_importing_spec.rb
chunky_png-1.3.6 spec/chunky_png/canvas/stream_importing_spec.rb
chunky_png-1.3.5 spec/chunky_png/canvas/stream_importing_spec.rb
chunky_png-1.3.4 spec/chunky_png/canvas/stream_importing_spec.rb
chunky_png-1.3.3 spec/chunky_png/canvas/stream_importing_spec.rb