Skip to content

Commit

Permalink
Merge pull request prawnpdf#708 from prawnpdf/issue_562
Browse files Browse the repository at this point in the history
failing test case for issue 562
  • Loading branch information
practicingruby committed Apr 9, 2014
2 parents da5df99 + b022a02 commit 5e6452f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/table_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,29 @@
end
end

describe "Text may be longer than the available space in a row on a single page" do
it "should not glitch the layout if there is too much text to fit onto a single row on a single page", :unresolved, :issue => 562 do
pdf = Prawn::Document.new({:page_size => "A4", :page_layout => :portrait})

table_data = Array.new
text = "This will be a very long text. "
4.times do text += text end
table_data.push([{:content => text, :rowspan => 2}, 'b', 'c'])
table_data.push(['b','c'])

column_widths = [50, 60, 400]

table = Prawn::Table.new table_data, pdf,:column_widths => column_widths

#render the table onto the pdf
table.draw

#expected behavior would be for the long text to be cut off or an exception to be raised
#thus we only expect a single page
pdf.page_count.should == 1
end
end

describe "You can explicitly set the column widths and use a colspan > 1" do

it "should tolerate floating point rounding errors < 0.000000001" do
Expand Down

0 comments on commit 5e6452f

Please sign in to comment.