Sha256: 21f3b27f33f0357a9283e502ead5aebb2a36f2836ce5bb328fd65f695a852b7f

Contents?: true

Size: 1.65 KB

Versions: 5

Compression:

Stored size: 1.65 KB

Contents

require 'spec_helper'

describe 'handling 7 slot stages' do

  let(:image) { ImageHelpers.horizontal_offset_cross_red }
  let(:sqed) do
    Sqed.new(
      image: image,
      pattern: :horizontal_offset_cross,
      boundary_color: :red,
      has_border: false )
  end

  let(:m) do
    { 0 => 'curator_metadata',
      1 => 'identifier',
      2 => 'image_registration',
      3 => 'annotated_specimen'
    }
  end

  context 'parses' do
    specify 'new() without errors' do
      expect(sqed).to be_truthy
    end

    specify 'get result without errors' do
      expect(sqed.result).to be_truthy
    end
  end

  context 'simple boundaries - without thumbnail' do
    let(:s) { Sqed.new(image: image, metadata_map: m, use_thumbnail: false, layout: :horizontal_offset_cross, boundary_color: :red, has_border: false ) }

    specify 'boundaries are reasonable' do
      s.result
      c = s.boundaries.coordinates
      c.each do |section, values|
        c[section].each_with_index do |v, i|
          msg = "section #{section}, index #{i} has a bad value '#{v}'"
          expect(v > -1).to be_truthy, msg
        end
      end
    end
  end

  context 'boundaries - with_thumbnail' do
    let(:s) { Sqed.new(image: ImageHelpers.horizontal_offset_cross_red, use_thumbnail: true, pattern: :horizontal_offset_cross, boundary_color: :red, has_border: false ) }

    specify 'boundaries are reasonable' do
      s.result
      c = s.boundaries.coordinates
      c.each do |section, values|
        c[section].each_with_index do |v, i|
          msg = "section #{section}, index #{i} has a bad value '#{v}'"
          expect(v > -1).to be_truthy, msg
        end
      end
    end
  end


end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sqed-0.5.8 spec/lib/stage_handling/horizontal_offset_cross_spec.rb
sqed-0.5.7 spec/lib/stage_handling/horizontal_offset_cross_spec.rb
sqed-0.5.6 spec/lib/stage_handling/horizontal_offset_cross_spec.rb
sqed-0.5.5 spec/lib/stage_handling/horizontal_offset_cross_spec.rb
sqed-0.5.4 spec/lib/stage_handling/horizontal_offset_cross_spec.rb