Sha256: dcc8a8c53334663093506d2351544cfa990a64c8eac412137c9ab041d6362ae0

Contents?: true

Size: 1005 Bytes

Versions: 1

Compression:

Stored size: 1005 Bytes

Contents

require 'mork'

RSpec.configure do |config|
  config.filter_run focus: true
  config.filter_run_excluding exclude: true
  config.run_all_when_everything_filtered = true
  config.expect_with :rspec do |c|
    c.syntax = [:should, :expect]
  end
end

RSpec::Matchers.define :have_coords do |x, y, w, h|
  match do |coord|
    coord.x == x and coord.y == y and coord.w == w and coord.h == h
  end
end

class SampleImager
  attr_reader :info

  def initialize(which)
    ya = YAML.load_file("./spec/samples/info.yml")
    @info = ya[which.to_s]
  end

  def grid_file
    @info["grid-file"]
  end

  def reg_marks
    @info["reg-marks"]
  end

  def q_boxes
    @info["q-boxes"]
  end

  def barcode_string
    @info["barcode-string"]
  end

  def barcode_int
    @info["barcode-int"]
  end

  def filename
    @info["filename"]
  end

  def width
    @info["width"]
  end

  def height
    @info["height"]
  end

  def pages
    @info["pages"]
  end

end

def sample_img(which)
  SampleImager.new(which)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mork-0.7.0 spec/spec_helper.rb