Sha256: 1224d0fed9d8b70c6c9f0155b0a7ce1145ed84be9a98f141e3e044aedac0c3c7

Contents?: true

Size: 702 Bytes

Versions: 3

Compression:

Stored size: 702 Bytes

Contents

require_relative "../../spec_helper"

module PhotoMosaic

  RSpec.describe Mosaic do

    let(:original) { "./spec/images/target.png" }
    let(:mosaic) { "./spec/images/mosaic.png" }

    context "compose_image" do
      it "generates a photo mosaic of the target image" do
        original_image = Image.import(original)
        reference_composite = Image.import(mosaic)
        tile_width, tile_height = 100, 100
        tile_images = Image.import(Dir["./spec/images/tiles/squares_bw/*"])
        mosaic = Mosaic.new(original_image, tile_images, tile_width, tile_height)
        mosaic_image = mosaic.join_tiles
        expect(mosaic_image).to eq(reference_composite)
      end
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
photo_mosaic-0.1.5 spec/lib/photo_mosaic/mosaic_spec.rb
photo_mosaic-0.1.4 spec/lib/photo_mosaic/mosaic_spec.rb
photo_mosaic-0.1.3 spec/lib/photo_mosaic/mosaic_spec.rb