Sha256: 5f98ebed7ec0dc2d52322df465040856c52f3327d086abe1f6935f46f7c14440

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

require 'spec_helper'

describe Languages::Zpl2::Font do
  context "#font_size :normal" do
    subject { Languages::Zpl2::Font.new :size => :normal}
    its(:name) { should eq "0" }
    its(:rotation) { should eq "N" }
    its(:height) { should eq 25 }
    its(:width) { should eq 25 }    
  end
  context "#font_size :small" do
    subject { Languages::Zpl2::Font.new :size => :small}
    its(:name) { should eq "0" }
    its(:rotation) { should eq "N" }
    its(:height) { should eq 20 }
    its(:width) { should eq 20 }    
  end
  context "#font_size :large" do
    subject { Languages::Zpl2::Font.new :size => :large}
    its(:name) { should eq "0" }
    its(:rotation) { should eq "N" }
    its(:height) { should eq 40 }
    its(:width) { should eq 40 }    
  end
  context "#font_size :x_large" do
    subject { Languages::Zpl2::Font.new :size => :x_large}
    its(:name) { should eq "0" }
    its(:rotation) { should eq "N" }
    its(:height) { should eq 60 }
    its(:width) { should eq 60 }    
  end

  context "#font_rotation" do
    let(:font) { Languages::Zpl2::Font.new }
    it ":by_90" do
      expect(font.font_rotation(:by_90)).to eq "R"
    end
    it ":by_180" do
      expect(font.font_rotation(:by_180)).to eq "I"
    end
    it ":by_270" do
      expect(font.font_rotation(:by_270)).to eq "B"
    end
    it ":by_0" do
      expect(font.font_rotation(:by_0)).to eq "N"
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zebra_printer-0.1.1 spec/lib/languages/zpl2/font_spec.rb