Sha256: 553709027b83f86d7a33e650420b81887792998156b4a39bd8e0b0b14332a986

Contents?: true

Size: 954 Bytes

Versions: 3

Compression:

Stored size: 954 Bytes

Contents

require 'spec_helper'

describe Languages::Generic::Millimetres do
  let(:mm_a) { Languages::Generic::Millimetres.new 25 }
  let(:mm_b) { Languages::Generic::Millimetres.new 20 }
  
  it "can add mm" do
    expect(mm_a + mm_b).to eq(Languages::Generic::Millimetres.new(45))
  end

  it "can subtract mm" do
    expect(mm_a - mm_b).to eq(Languages::Generic::Millimetres.new(5))
  end

  it "can add int" do
    expect(5 + mm_b).to eq(mm_a)
    expect(mm_b + 5).to eq(mm_a)
  end

  it "can subtract mm" do
    expect(25 - mm_b).to eq(Languages::Generic::Millimetres.new(5))
    expect(mm_a - 20).to eq(Languages::Generic::Millimetres.new(5))
  end
  
  it "compare mm" do
    expect(mm_a).to eq(Languages::Generic::Millimetres.new(25))
  end

  it "25 mm at 203 DPI" do
    expect(mm_a.to_dots).to eq(Languages::Generic::Dots.new(200))
  end

  it "25 mm at 300 DPI" do
    expect(mm_a.to_dots(:dpi300)).to eq(Languages::Generic::Dots.new(295))
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
zebra_printer-0.9.0 spec/lib/languages/generic/millimetres_spec.rb
zebra_printer-0.8.0 spec/lib/languages/generic/millimetres_spec.rb
zebra_printer-0.1.1 spec/lib/languages/generic/millimetres.rb