Sha256: b8a904285f0849c085fa23d86503dd2c150f9a03091258a2829b3b357794736d

Contents?: true

Size: 913 Bytes

Versions: 1

Compression:

Stored size: 913 Bytes

Contents

require 'spec_helper'

describe Gatling::Comparison do

  before do
    apple = Magick::Image.new(100,100) { self.background_color = "green" }
    orange = Magick::Image.new(100,100) { self.background_color = "orange" }
    @apple = Gatling::Image.new(:from_diff, 'apple.png', apple)
    @orange = Gatling::Image.new(:from_diff, 'orange.png', orange)
  end

  describe 'will compare two images' do

    it 'will return true if the images are identical' do
      subject = Gatling::Comparison.new(@apple, @apple)
      subject.match.should == true
    end

    it 'will return false if the images are different' do
      subject = Gatling::Comparison.new(@apple, @orange)
      subject.match.should == false
    end
  end

  describe 'Diff images' do
    it 'will give us a diff' do
      subject = Gatling::Comparison.new(@apple, @orange)
      subject.diff_image.class.should == Gatling::Image
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gatling-1.0.7 spec/comparison_spec.rb