Skip to content

Commit

Permalink
spec for issue prawnpdf#347
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario1988 committed Sep 26, 2014
1 parent fa80690 commit 021a7f6
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions spec/line_wrap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,27 +128,32 @@
string.should == "hello#{Prawn::Text::SHY}"
end

it "should not display soft hyphens except at the end of a line" do
string = @pdf.font.normalize_encoding("hello#{Prawn::Text::SHY}world")
array = [{ :text => string }]
it "should not display soft hyphens except at the end of a line " +
"for more than one element in format_array", :issue => 347 do
string1 = @pdf.font.normalize_encoding("hello#{Prawn::Text::SHY}world ")
string2 = @pdf.font.normalize_encoding("hi#{Prawn::Text::SHY}earth")
array = [{ :text => string1 }, { :text => string2 }]
@arranger.format_array = array
string = @line_wrap.wrap_line(:arranger => @arranger,
:width => 300,
:document => @pdf)
string.should == "helloworld"
string.should == "helloworld hiearth"

@pdf.font("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf")
@line_wrap = Prawn::Text::Formatted::LineWrap.new

string = "hello#{Prawn::Text::SHY}world"
array = [{ :text => string }]
string1 = "hello#{Prawn::Text::SHY}world "
string2 = @pdf.font.normalize_encoding("hi#{Prawn::Text::SHY}earth")
array = [{ :text => string1 }, { :text => string2 }]
@arranger.format_array = array
string = @line_wrap.wrap_line(:arranger => @arranger,
:width => 300,
:document => @pdf)
string.should == "helloworld"
string.should == "helloworld hiearth"
end

it 'should not display soft hyphens except at the end of a line'

it "should not break before a hard hyphen that follows a word" do
enough_width_for_hello_world = 60

Expand Down

0 comments on commit 021a7f6

Please sign in to comment.