Sha256: c6b21b1d05698c22c7007406737935545fa14fd8341687eea71cc39daba0d0db

Contents?: true

Size: 620 Bytes

Versions: 31

Compression:

Stored size: 620 Bytes

Contents

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.close(2.834645669, 0.000000001)
    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

31 entries across 31 versions & 9 rubygems

Version Path
kavu-prawn-core-0.4.100 spec/measurement_units_spec.rb
kavu-prawn-core-0.4.99 spec/measurement_units_spec.rb
prawn-1.0.0.rc1 spec/measurement_units_spec.rb
prawn-0.12.0 spec/measurement_units_spec.rb
prawn-0.11.1 spec/measurement_units_spec.rb
davebenvenuti-prawn-0.11.1.pre spec/measurement_units_spec.rb
piglop-prawn-0.10.2.3 spec/measurement_units_spec.rb
piglop-prawn-0.10.2.2 spec/measurement_units_spec.rb
piglop-prawn-0.10.2.1 spec/measurement_units_spec.rb
prawn-0.11.1.pre spec/measurement_units_spec.rb
goodwill-prawn-edge-0.10.0 spec/measurement_units_spec.rb
alphasights-prawn-0.10.4 spec/measurement_units_spec.rb
alphasights-prawn-0.10.3 spec/measurement_units_spec.rb
alphasights-prawn-0.10.2 spec/measurement_units_spec.rb
alphasights-prawn-0.10.1 spec/measurement_units_spec.rb
alphasights-prawn-0.10.0 spec/measurement_units_spec.rb
prawn-core-0.8.4 spec/measurement_units_spec.rb
prawn-graph-0.0.2 vendor/prawn-core/spec/measurement_units_spec.rb
prawn-graph-0.0.1 vendor/prawn-core/spec/measurement_units_spec.rb
prawn-core-0.7.2 spec/measurement_units_spec.rb