Sha256: b3804d90338342af6130c2476ffed58c58aab33807d0a822c9d6516acea0ba08

Contents?: true

Size: 623 Bytes

Versions: 6

Compression:

Stored size: 623 Bytes

Contents

# encoding: utf-8

require File.join(File.expand_path(File.dirname(__FILE__)), "spec_helper")
require "prawn/measurement_extensions"

describe "Measurement units" do

  it "should convert units to PostScriptPoints" do
    1.mm.should be_within(0.000000001).of(2.834645669)
    1.mm.should == (72 / 25.4)
    2.mm.should == (2 * 72 / 25.4)
    3.mm.should == 3 * 72 / 25.4
    -3.mm.should == -3 * 72/25.4
    1.cm.should == 10 * 72 / 25.4
    1.dm.should == 100 * 72 / 25.4
    1.m.should == 1000 * 72 / 25.4

    1.in.should == 72
    1.ft.should == 72 * 12
    1.yd.should == 72 * 12 * 3
    1.pt.should == 1
  end

end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
prawn-git-2.0.1 spec/measurement_units_spec.rb
prawn-2.0.1 spec/measurement_units_spec.rb
prawn-2.0.0 spec/measurement_units_spec.rb
prawn-1.3.0 spec/measurement_units_spec.rb
prawn-1.2.1 spec/measurement_units_spec.rb
prawn-1.1.0 spec/measurement_units_spec.rb