Sha256: f1491a75983d926d9719e56e8579e6b43bfe886adc26b184d619bd6fc5d07d13

Contents?: true

Size: 829 Bytes

Versions: 9

Compression:

Stored size: 829 Bytes

Contents

# encoding: utf-8
require File.join(File.expand_path(File.dirname(__FILE__)), "spec_helper") 

describe "When beginning each new page" do

  it "should execute codeblock given to Document#header" do
    call_count = 0    
   
    pdf = Prawn::Document.new      
    pdf.header(pdf.margin_box.top_left) do 
      call_count += 1   
    end
    
    pdf.start_new_page 
    pdf.start_new_page 
    pdf.render
    
    call_count.should == 3
  end

end

describe "When ending each page" do

  it "should execute codeblock given to Document#footer" do
   
    call_count = 0    
   
    pdf = Prawn::Document.new      
    pdf.footer([pdf.margin_box.left, pdf.margin_box.bottom + 50]) do 
      call_count += 1   
    end
    
    pdf.start_new_page 
    pdf.start_new_page 
    pdf.render
    
    call_count.should == 3
  end

end

Version data entries

9 entries across 9 versions & 4 rubygems

Version Path
jerryvos-prawn-layout-0.2.0.4 spec/page_layout_spec.rb
sskirby-prawn-layout-0.1.1 spec/page_layout_spec.rb
prawn-flexible-table-0.1.2 spec/page_layout_spec.rb
prawn-flexible-table-0.1.1 spec/page_layout_spec.rb
prawn-flexible-table-0.1 spec/page_layout_spec.rb
prawn-layout-0.3.2 spec/page_layout_spec.rb
prawn-layout-0.3.1 spec/page_layout_spec.rb
prawn-layout-0.2.1 spec/page_layout_spec.rb
prawn-layout-0.2.0.1 spec/page_layout_spec.rb