Sha256: a7932cd63639b6645b71000b5b04392bd5213ed96592f578ca06ebeecebab0e4

Contents?: true

Size: 962 Bytes

Versions: 5

Compression:

Stored size: 962 Bytes

Contents

# encoding: utf-8

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

describe "A column box" do
  it "has sensible left and right values" do
    create_pdf
    @pdf.column_box [0, @pdf.cursor], :width => @pdf.bounds.width,
      :height => 200, :columns => 3, :spacer => 25 do
        left = @pdf.bounds.left
        right = @pdf.bounds.right

        @pdf.bounds.move_past_bottom # next column

        @pdf.bounds.left.should be > left
        @pdf.bounds.left.should be > right
        @pdf.bounds.right.should be > @pdf.bounds.left
      end
  end

  it "includes spacers between columns but not at the end" do
    create_pdf
    @pdf.column_box [0, @pdf.cursor], :width => 500,
      :height => 200, :columns => 3, :spacer => 25 do
        @pdf.bounds.width.should == 150 # (500 - (25 * 2)) / 3

        @pdf.bounds.move_past_bottom
        @pdf.bounds.move_past_bottom

        @pdf.bounds.right.should == 500
      end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
prawn-0.13.2 spec/column_box_spec.rb
prawn-0.13.1 spec/column_box_spec.rb
prawn-0.13.0 spec/column_box_spec.rb
prawn-1.0.0.rc2 spec/column_box_spec.rb
nurettin-prawn-1.0.0.rc1 spec/column_box_spec.rb