Sha256: 1fb6139e8798f70a4814b5f1ff617272720f982fd2634311f64d568bd8ecc5d2

Contents?: true

Size: 722 Bytes

Versions: 25

Compression:

Stored size: 722 Bytes

Contents

require 'spec_helper'

describe Sqed::BoundaryFinder::CrossFinder do
  let(:image) { ImageHelpers.of_size(800, 600) }
  let(:b) {Sqed::BoundaryFinder::CrossFinder.new(image: image)}
  let(:c) {b.boundaries}

  specify '#boundaries returns a Sqed::Boundaries instance' do
    expect(b.boundaries.class).to eq(Sqed::Boundaries)
  end

  specify 'the 0th image starts at x = 0' do
    expect(c.x_for(0)).to eq(0)
  end

  specify 'the 0th image starts at y = 0' do
    expect(c.y_for(0)).to eq(0)
  end

  specify 'the 0th image has width = 400' do
    expect(c.width_for(0)).to eq(400)
  end

  specify 'the 0th image has height = 300' do
    pct = 0.02
    expect(c.height_for(0)).to be_within(pct*300).of(300)
  end

end 

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
sqed-0.4.0 spec/lib/sqed/boundary_finder/cross_finder_spec.rb
sqed-0.1.9 spec/lib/sqed/boundary_finder/cross_finder_spec.rb
sqed-0.1.8 spec/lib/sqed/boundary_finder/cross_finder_spec.rb
sqed-0.1.7 spec/lib/sqed/boundary_finder/cross_finder_spec.rb
sqed-0.1.6 spec/lib/sqed/boundary_finder/cross_finder_spec.rb