[DRE-commits] [ruby-prawn] 01/01: WIP: 0990_rspec3.patch for RSpec 3 support

Cédric Boutillier boutil at moszumanska.debian.org
Wed Apr 29 14:39:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to branch master
in repository ruby-prawn.

commit e20d293cc5dc302438f7b56dfee940afba86e170
Author: Cédric Boutillier <boutil at debian.org>
Date:   Wed Apr 29 16:39:20 2015 +0200

    WIP: 0990_rspec3.patch for RSpec 3 support
---
 debian/patches/0990_rspec3.patch | 666 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 666 insertions(+)

diff --git a/debian/patches/0990_rspec3.patch b/debian/patches/0990_rspec3.patch
new file mode 100644
index 0000000..9c7b234
--- /dev/null
+++ b/debian/patches/0990_rspec3.patch
@@ -0,0 +1,666 @@
+Description: preliminary version of a patch for RSpec 3 support
+Author: Cédric Boutillier <boutil at debian.org>
+Last-Update: 2015-04-29
+
+--- a/spec/text_box_spec.rb
++++ b/spec/text_box_spec.rb
+@@ -3,43 +3,43 @@
+ require File.join(File.expand_path(File.dirname(__FILE__)), "spec_helper")
+ 
+ describe "Text::Box#nothing_printed?" do
+-  it "should be_true when nothing printed" do
++  it "should be_truthy when nothing printed" do
+     create_pdf
+     string = "Hello world, how are you?\nI'm fine, thank you."
+     text_box = Prawn::Text::Box.new(string,
+                                     :height => 2,
+                                     :document => @pdf)
+     text_box.render
+-    text_box.nothing_printed?.should be_true
++    expect(text_box.nothing_printed?).to be_truthy
+   end
+-  it "should be_false when something printed" do
++  it "should be_falsey when something printed" do
+     create_pdf
+     string = "Hello world, how are you?\nI'm fine, thank you."
+     text_box = Prawn::Text::Box.new(string,
+                                     :height => 14,
+                                     :document => @pdf)
+     text_box.render
+-    text_box.nothing_printed?.should be_false
++    expect(text_box.nothing_printed?).to be_falsey
+   end
+ end
+ 
+ describe "Text::Box#everything_printed?" do
+-  it "should be_false when not everything printed" do
++  it "should be_falsey when not everything printed" do
+     create_pdf
+     string = "Hello world, how are you?\nI'm fine, thank you."
+     text_box = Prawn::Text::Box.new(string,
+                                     :height => 14,
+                                     :document => @pdf)
+     text_box.render
+-    text_box.everything_printed?.should be_false
++    expect(text_box.everything_printed?).to be_falsey
+   end
+-  it "should be_true when everything printed" do
++  it "should be_truthy when everything printed" do
+     create_pdf
+     string = "Hello world, how are you?\nI'm fine, thank you."
+     text_box = Prawn::Text::Box.new(string,
+                                     :document => @pdf)
+     text_box.render
+-    text_box.everything_printed?.should be_true
++    expect(text_box.everything_printed?).to be_truthy
+   end
+ end
+ 
+@@ -51,7 +51,7 @@
+     text_box = Prawn::Text::Box.new(string,
+                                     :document => @pdf)
+     text_box.render
+-    text_box.line_gap.should be_within(0.0001).of(@pdf.font.line_gap)
++    expect(text_box.line_gap).to be_within(0.0001).of(@pdf.font.line_gap)
+   end
+ end
+ 
+@@ -65,8 +65,8 @@
+                                     :document => @pdf)
+     text_box.render
+     text = PDF::Inspector::Text.analyze(@pdf.render)
+-    text.strings[0].should == "?uoy era woh ,dlrow olleH"
+-    text.strings[1].should == ".uoy knaht ,enif m'I"
++    expect(text.strings[0]).to eq "?uoy era woh ,dlrow olleH"
++    expect(text.strings[1]).to eq ".uoy knaht ,enif m'I"
+   end
+ 
+   it "should be able to reverse multi-byte text" do
+@@ -78,7 +78,7 @@
+       @pdf.text "写个小"
+     end
+     text = PDF::Inspector::Text.analyze(@pdf.render)
+-    text.strings[0].should == "小个写"
++    expect(text.strings[0]).to eq "小个写"
+   end
+ 
+   it "option should be able to override document-wide text direction" do
+@@ -90,8 +90,8 @@
+                                     :direction => :ltr)
+     text_box.render
+     text = PDF::Inspector::Text.analyze(@pdf.render)
+-    text.strings[0].should == "Hello world, how are you?"
+-    text.strings[1].should == "I'm fine, thank you."
++    expect(text.strings[0]).to eq "Hello world, how are you?"
++    expect(text.strings[1]).to eq "I'm fine, thank you."
+   end
+ end
+ 
+@@ -103,7 +103,7 @@
+     @pdf.default_leading = 7
+     text_box = Prawn::Text::Box.new("hello world",
+                                     :document => @pdf)
+-    text_box.leading.should == 7
++    expect(text_box.leading).to eq 7
+   end
+ 
+   it "option should be able to override document-wide leading" do
+@@ -112,7 +112,7 @@
+     text_box = Prawn::Text::Box.new("hello world",
+                                     :document => @pdf,
+                                     :leading => 20)
+-    text_box.leading.should == 20
++    expect(text_box.leading).to eq 20
+   end
+   it "should default to document-wide leading if no" +
+     "leading option is provided" do
+@@ -128,7 +128,7 @@
+     text_box = Prawn::Text::Box.new(string, options)
+     text_box.render
+     contents = PDF::Inspector::Text.analyze(@pdf.render)
+-    contents.word_spacing[0].should be > 0
++    expect(contents.word_spacing[0]).to be > 0
+   end
+   it "should not justify the last line of a paragraph" do
+     create_pdf
+@@ -137,7 +137,7 @@
+     text_box = Prawn::Text::Box.new(string, options)
+     text_box.render
+     contents = PDF::Inspector::Text.analyze(@pdf.render)
+-    contents.word_spacing.should be_empty
++    expect(contents.word_spacing).to be_empty
+   end
+ end
+ 
+@@ -149,13 +149,13 @@
+     options = { :document => @pdf, :height => @pdf.font.ascender + @pdf.font.descender }
+     text_box = Prawn::Text::Box.new(text, options)
+     text_box.render
+-    text_box.text.should == "Oh hai text rect"
++    expect(text_box.text).to eq "Oh hai text rect"
+ 
+     text = "Oh hai text rect\nOh hai text rect"
+     options = { :document => @pdf, :height => @pdf.font.height + @pdf.font.ascender + @pdf.font.descender }
+     text_box = Prawn::Text::Box.new(text, options)
+     text_box.render
+-    text_box.text.should == "Oh hai text rect\nOh hai text rect"
++    expect(text_box.text).to eq "Oh hai text rect\nOh hai text rect"
+   end
+ end
+ 
+@@ -167,7 +167,7 @@
+     options = { :document => @pdf }
+     text_box = Prawn::Text::Box.new(text, options)
+     text_box.render
+-    text_box.height.should be_within(0.001).of(@pdf.font.height * 2 - @pdf.font.line_gap)
++    expect(text_box.height).to be_within(0.001).of(@pdf.font.height * 2 - @pdf.font.line_gap)
+   end
+ end
+ 
+@@ -180,7 +180,7 @@
+     options = { :document => @pdf, :leading => leading }
+     text_box = Prawn::Text::Box.new(text, options)
+     text_box.render
+-    text_box.height.should be_within(0.001).of((@pdf.font.height + leading) * 2 - @pdf.font.line_gap - leading)
++    expect(text_box.height).to be_within(0.001).of((@pdf.font.height + leading) * 2 - @pdf.font.line_gap - leading)
+   end
+ end
+ 
+@@ -219,7 +219,7 @@
+   it "should return an array" do
+     create_pdf
+     text_box = Prawn::Text::Box.new("", :document => @pdf)
+-    text_box.valid_options.should be_a_kind_of(Array)
++    expect(text_box.valid_options).to be_a_kind_of(Array)
+   end
+ end
+ 
+@@ -233,7 +233,7 @@
+     }
+     text_box = Prawn::Text::Box.new(@text, @options)
+     text_box.render
+-    text_box.text.should == ""
++    expect(text_box.text).to eq ""
+   end
+   it "should draw content to the page" do
+     create_pdf
+@@ -242,7 +242,7 @@
+     text_box = Prawn::Text::Box.new(@text, @options)
+     text_box.render
+     text = PDF::Inspector::Text.analyze(@pdf.render)
+-    text.strings.should_not be_empty
++    expect(text.strings).not_to be_empty
+   end
+   it "should not draw a transformation matrix" do
+     create_pdf
+@@ -251,7 +251,7 @@
+     text_box = Prawn::Text::Box.new(@text, @options)
+     text_box.render
+     matrices = PDF::Inspector::Graphics::Matrix.analyze(@pdf.render)
+-    matrices.matrices.length.should == 0
++    expect(matrices.matrices.length).to eq 0
+   end
+ end
+ 
+@@ -264,7 +264,7 @@
+     text_box = Prawn::Text::Box.new(@text, @options)
+     text_box.render
+     text = PDF::Inspector::Text.analyze(@pdf.render)
+-    text.strings.length.should == 1
++    expect(text.strings.length).to eq 1
+   end
+ end
+ 
+@@ -276,7 +276,7 @@
+     text_box = Prawn::Text::Box.new(@text, @options)
+     text_box.render(:dry_run => true)
+     text = PDF::Inspector::Text.analyze(@pdf.render)
+-    text.strings.should be_empty
++    expect(text.strings).to be_empty
+   end
+ 
+   it "subsequent calls to render should_not raise_error an ArgumentError exception" do
+@@ -303,7 +303,7 @@
+     original_at = text_box.at.dup
+ 
+     text_box.render(:dry_run => true)
+-    text_box.at.should == original_at
++    expect(text_box.at).to eq original_at
+   end
+ end
+ 
+@@ -320,7 +320,7 @@
+     original_at = text_box.at.dup
+ 
+     text_box.render(:dry_run => true)
+-    text_box.at.should == original_at
++    expect(text_box.at).to eq original_at
+   end
+ end
+ 
+@@ -352,16 +352,16 @@
+       y = @y - @height / 2
+       x_prime = x * @cos - y * @sin
+       y_prime = x * @sin + y * @cos
+-      matrices.matrices[0].should == [1, 0, 0, 1,
++      expect(matrices.matrices[0]).to eq [1, 0, 0, 1,
+                                       reduce_precision(x - x_prime),
+                                       reduce_precision(y - y_prime)]
+-      matrices.matrices[1].should == [reduce_precision(@cos),
++      expect(matrices.matrices[1]).to eq [reduce_precision(@cos),
+                                       reduce_precision(@sin),
+                                       reduce_precision(- at sin),
+                                       reduce_precision(@cos), 0, 0]
+ 
+       text = PDF::Inspector::Text.analyze(@pdf.render)
+-      text.strings.should_not be_empty
++      expect(text.strings).not_to be_empty
+     end
+   end
+   context ":rotate_around option of :upper_left" do
+@@ -384,7 +384,7 @@
+                                       reduce_precision(@cos), 0, 0]
+ 
+       text = PDF::Inspector::Text.analyze(@pdf.render)
+-      text.strings.should_not be_empty
++      expect(text.strings).not_to be_empty
+     end
+   end
+   context "default :rotate_around" do
+@@ -397,16 +397,16 @@
+       y = @y
+       x_prime = x * @cos - y * @sin
+       y_prime = x * @sin + y * @cos
+-      matrices.matrices[0].should == [1, 0, 0, 1,
++      expect(matrices.matrices[0]).to eq [1, 0, 0, 1,
+                                       reduce_precision(x - x_prime),
+                                       reduce_precision(y - y_prime)]
+-      matrices.matrices[1].should == [reduce_precision(@cos),
++      expect(matrices.matrices[1]).to eq [reduce_precision(@cos),
+                                       reduce_precision(@sin),
+                                       reduce_precision(- at sin),
+                                       reduce_precision(@cos), 0, 0]
+ 
+       text = PDF::Inspector::Text.analyze(@pdf.render)
+-      text.strings.should_not be_empty
++      expect(text.strings).not_to be_empty
+     end
+   end
+   context ":rotate_around option of :upper_right" do
+--- a/spec/graphics_spec.rb
++++ b/spec/graphics_spec.rb
+@@ -298,10 +298,10 @@
+       pattern[:Shading][:Coords].should == [0, 0, @pdf.bounds.width, 0]
+       pattern[:Shading][:Function][:C0].zip([1, 0, 0]).all?{ |x1, x2|
+         (x1-x2).abs < 0.01
+-      }.should be_true
++      }.should be_truthy
+       pattern[:Shading][:Function][:C1].zip([0, 0, 1]).all?{ |x1, x2|
+         (x1-x2).abs < 0.01
+-      }.should be_true
++      }.should be_truthy
+     end
+ 
+     it "fill_gradient should set fill color to the pattern" do
+@@ -334,10 +334,10 @@
+       pattern[:Shading][:Coords].should == [0, 0, 10, @pdf.bounds.width, 0, 20]
+       pattern[:Shading][:Function][:C0].zip([1, 0, 0]).all?{ |x1, x2|
+         (x1-x2).abs < 0.01
+-      }.should be_true
++      }.should be_truthy
+       pattern[:Shading][:Function][:C1].zip([0, 0, 1]).all?{ |x1, x2|
+         (x1-x2).abs < 0.01
+-      }.should be_true
++      }.should be_truthy
+     end
+ 
+     it "fill_gradient should set fill color to the pattern" do
+--- a/spec/repeater_spec.rb
++++ b/spec/repeater_spec.rb
+@@ -19,7 +19,7 @@
+     doc = sample_document
+     r = repeater(doc, :all) { :do_nothing }
+ 
+-    (1..doc.page_count).all? { |i| r.match?(i) }.should be_true
++    (1..doc.page_count).all? { |i| r.match?(i) }.should be_truthy
+   end
+ 
+   it "must provide an :odd filter" do
+@@ -28,8 +28,8 @@
+ 
+     odd, even = (1..doc.page_count).partition { |e| e % 2 == 1 }
+ 
+-    odd.all? { |i| r.match?(i) }.should be_true
+-    even.any? { |i| r.match?(i) }.should be_false
++    odd.all? { |i| r.match?(i) }.should be_truthy
++    even.any? { |i| r.match?(i) }.should be_falsey
+   end
+ 
+   it "must be able to filter by an array of page numbers" do
+--- a/spec/formatted_text_fragment_spec.rb
++++ b/spec/formatted_text_fragment_spec.rb
+@@ -224,7 +224,7 @@
+     @fragment.ascender = 17
+   end
+   describe "#subscript?" do
+-    it "should be_true" do
++    it "should be_truthy" do
+       @fragment.should be_subscript
+     end
+   end
+@@ -252,7 +252,7 @@
+     @fragment.ascender = 17
+   end
+   describe "#superscript?" do
+-    it "should be_true" do
++    it "should be_truthy" do
+       @fragment.should be_superscript
+     end
+   end
+--- a/spec/font_spec.rb
++++ b/spec/font_spec.rb
+@@ -257,11 +257,11 @@
+   end
+ 
+   def page_should_include_font(font)
+-    page_includes_font?(font).should be_true
++    page_includes_font?(font).should be_truthy
+   end
+ 
+   def page_should_not_include_font(font)
+-    page_includes_font?(font).should be_false
++    page_includes_font?(font).should be_falsey
+   end
+ 
+ end
+@@ -308,13 +308,13 @@
+     it "should not modify the original string when normalize_encoding() is used" do
+       original = "Foo"
+       normalized = @times.normalize_encoding(original)
+-      original.equal?(normalized).should be_false
++      original.equal?(normalized).should be_falsey
+     end
+ 
+     it "should modify the original string when normalize_encoding!() is used" do
+       original = "Foo"
+       normalized = @times.normalize_encoding!(original)
+-      original.equal?(normalized).should be_true
++      original.equal?(normalized).should be_truthy
+     end
+ 
+   end
+@@ -332,25 +332,25 @@
+ 
+   it "should return true when present in an AFM font" do
+     font = @pdf.find_font("Helvetica")
+-    font.glyph_present?("H").should be_true
++    font.glyph_present?("H").should be_truthy
+   end
+ 
+   it "should return false when absent in an AFM font" do
+     font = @pdf.find_font("Helvetica")
+-    font.glyph_present?("再").should be_false
++    font.glyph_present?("再").should be_falsey
+   end
+ 
+   it "should return true when present in a TTF font" do
+     font = @pdf.find_font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf")
+-    font.glyph_present?("H").should be_true
++    font.glyph_present?("H").should be_truthy
+   end
+ 
+   it "should return false when absent in a TTF font" do
+     font = @pdf.find_font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf")
+-    font.glyph_present?("再").should be_false
++    font.glyph_present?("再").should be_falsey
+ 
+     font = @pdf.find_font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf")
+-    font.glyph_present?("€").should be_false
++    font.glyph_present?("€").should be_falsey
+   end
+ end
+ 
+@@ -408,13 +408,13 @@
+     it "should not modify the original string when normalize_encoding() is used" do
+       original = "Foo"
+       normalized = @font.normalize_encoding(original)
+-      original.equal?(normalized).should be_false
++      original.equal?(normalized).should be_falsey
+     end
+ 
+     it "should modify the original string when normalize_encoding!() is used" do
+       original = "Foo"
+       normalized = @font.normalize_encoding!(original)
+-      original.equal?(normalized).should be_true
++      original.equal?(normalized).should be_truthy
+     end
+ 
+   end
+--- a/spec/line_wrap_spec.rb
++++ b/spec/line_wrap_spec.rb
+@@ -322,7 +322,7 @@
+     @line_wrap = Prawn::Text::Formatted::LineWrap.new
+     @one_word_width = 50
+   end
+-  it "should be_false when the last printed line is not the end of the paragraph" do
++  it "should be_falsey when the last printed line is not the end of the paragraph" do
+     array = [{ :text => "hello world" }]
+     @arranger.format_array = array
+     string = @line_wrap.wrap_line(:arranger => @arranger,
+@@ -331,7 +331,7 @@
+ 
+     @line_wrap.paragraph_finished?.should == false
+   end
+-  it "should be_true when the last printed line is the last fragment to print" do
++  it "should be_truthy when the last printed line is the last fragment to print" do
+     array = [{ :text => "hello world" }]
+     @arranger.format_array = array
+     string = @line_wrap.wrap_line(:arranger => @arranger,
+@@ -343,7 +343,7 @@
+ 
+     @line_wrap.paragraph_finished?.should == true
+   end
+-  it "should be_true when a newline exists on the current line" do
++  it "should be_truthy when a newline exists on the current line" do
+     array = [{ :text => "hello\n world" }]
+     @arranger.format_array = array
+     string = @line_wrap.wrap_line(:arranger => @arranger,
+@@ -352,7 +352,7 @@
+ 
+     @line_wrap.paragraph_finished?.should == true
+   end
+-  it "should be_true when a newline exists in the next fragment" do
++  it "should be_truthy when a newline exists in the next fragment" do
+     array = [{ :text => "hello " },
+              { :text => " \n" },
+              { :text => "world" }]
+--- a/spec/stroke_styles_spec.rb
++++ b/spec/stroke_styles_spec.rb
+@@ -108,7 +108,7 @@
+   end
+ 
+   describe "setting a dash" do
+-    it "dashed? should be_true" do
++    it "dashed? should be_truthy" do
+       @pdf.dash(2)
+       @pdf.should be_dashed
+     end
+--- a/spec/text_spec.rb
++++ b/spec/text_spec.rb
+@@ -63,7 +63,7 @@
+   end
+ 
+   it "should ignore call when string is nil" do
+-    @pdf.text(nil).should be_false
++    @pdf.text(nil).should be_falsey
+   end
+ 
+   it "should correctly render empty paragraphs" do
+@@ -91,13 +91,13 @@
+   it "should default to use kerning information" do
+     @pdf.text "hello world"
+     text = PDF::Inspector::Text.analyze(@pdf.render)
+-    text.kerned[0].should be_true
++    text.kerned[0].should be_truthy
+   end
+ 
+   it "should be able to disable kerning with an option" do
+     @pdf.text "hello world", :kerning => false
+     text = PDF::Inspector::Text.analyze(@pdf.render)
+-    text.kerned[0].should be_false
++    text.kerned[0].should be_falsey
+   end
+ 
+   it "should be able to disable kerning document-wide" do
+@@ -105,14 +105,14 @@
+     @pdf.default_kerning = false
+     @pdf.text "hello world"
+     text = PDF::Inspector::Text.analyze(@pdf.render)
+-    text.kerned[0].should be_false
++    text.kerned[0].should be_falsey
+   end
+ 
+   it "option should be able to override document-wide kerning disabling" do
+     @pdf.default_kerning = false
+     @pdf.text "hello world", :kerning => true
+     text = PDF::Inspector::Text.analyze(@pdf.render)
+-    text.kerned[0].should be_true
++    text.kerned[0].should be_truthy
+   end
+ 
+   it "should raise_error ArgumentError if :at option included" do
+--- a/spec/document_spec.rb
++++ b/spec/document_spec.rb
+@@ -77,14 +77,14 @@
+     Prawn::Document.extensions.delete(mod1)
+     Prawn::Document.extensions.delete(mod2)
+ 
+-    Prawn::Document.new.respond_to?(:test_extensions1).should be_false
+-    Prawn::Document.new.respond_to?(:test_extensions2).should be_false
++    Prawn::Document.new.respond_to?(:test_extensions1).should be_falsey
++    Prawn::Document.new.respond_to?(:test_extensions2).should be_falsey
+ 
+     # verify these still exist on custom class
+     custom_document.extensions.should == [mod1, mod2]
+ 
+-    custom_document.new.respond_to?(:test_extensions1).should be_true
+-    custom_document.new.respond_to?(:test_extensions2).should be_true
++    custom_document.new.respond_to?(:test_extensions1).should be_truthy
++    custom_document.new.respond_to?(:test_extensions2).should be_truthy
+   end
+ 
+ end
+@@ -181,7 +181,7 @@
+   end
+ 
+   it "should be delegated from Document to renderer" do
+-    expect(@pdf.respond_to?(:on_page_create)).to be_true
++    expect(@pdf.respond_to?(:on_page_create)).to be_truthy
+   end
+ 
+   it "should be invoked with document" do
+@@ -718,17 +718,17 @@
+   end
+ 
+   it "returns nil given no filter" do
+-    @pdf.page_match?(:nil, 1).should be_false
++    @pdf.page_match?(:nil, 1).should be_falsey
+   end
+ 
+   it "must provide an :all filter" do
+-    (1.. at pdf.page_count).all? { |i| @pdf.page_match?(:all, i) }.should be_true
++    (1.. at pdf.page_count).all? { |i| @pdf.page_match?(:all, i) }.should be_truthy
+   end
+ 
+   it "must provide an :odd filter" do
+     odd, even = (1.. at pdf.page_count).partition { |e| e % 2 == 1 }
+-    odd.all? { |i| @pdf.page_match?(:odd, i) }.should be_true
+-    even.any? { |i| @pdf.page_match?(:odd, i) }.should be_false
++    odd.all? { |i| @pdf.page_match?(:odd, i) }.should be_truthy
++    even.any? { |i| @pdf.page_match?(:odd, i) }.should be_falsey
+   end
+ 
+   it "must be able to filter by an array of page numbers" do
+--- a/spec/font_metric_cache_spec.rb
++++ b/spec/font_metric_cache_spec.rb
+@@ -15,21 +15,21 @@
+   it "should cache the width of the provided string" do
+     subject.width_of('M', {})
+ 
+-    subject.instance_variable_get( :@cache ).should have(1).entry
++    expect(subject.instance_variable_get( :@cache ).size).to eq(1)
+   end
+ 
+   it "should only cache a single copy of the same string" do
+     subject.width_of('M', {})
+     subject.width_of('M', {})
+ 
+-    subject.instance_variable_get( :@cache ).should have(1).entry
++    expect(subject.instance_variable_get( :@cache ).size).to eq(1)
+   end
+ 
+   it "should cache different copies for different strings" do
+     subject.width_of('M', {})
+     subject.width_of('W', {})
+ 
+-    subject.instance_variable_get( :@cache ).should have(2).entries
++    expect(subject.instance_variable_get( :@cache ).size).to eq(2)
+   end
+ 
+   it "should cache different copies of the same string with different font sizes" do
+@@ -38,7 +38,7 @@
+     document.font_size 24
+     subject.width_of('M', {})
+ 
+-    subject.instance_variable_get( :@cache ).should have(2).entries
++    expect(subject.instance_variable_get( :@cache ).size).to eq(2)
+   end
+ 
+   it "should cache different copies of the same string with different fonts" do
+@@ -47,6 +47,6 @@
+     document.font 'Courier'
+     subject.width_of('M', {})
+ 
+-    subject.instance_variable_get( :@cache ).should have(2).entries
++    expect(subject.instance_variable_get( :@cache ).size).to eq(2)
+   end
+ end
+--- a/spec/text_at_spec.rb
++++ b/spec/text_at_spec.rb
+@@ -58,7 +58,7 @@
+ 
+     text = rotated_text_inspector.analyze(@pdf.render)
+ 
+-    text.tm_operator_used.should(be_true)
++    text.tm_operator_used.should(be_truthy)
+   end
+ 
+   it "should not use rotation matrix by default" do
+@@ -66,7 +66,7 @@
+ 
+     text = rotated_text_inspector.analyze(@pdf.render)
+ 
+-    text.tm_operator_used.should(be_false)
++    text.tm_operator_used.should(be_falsey)
+   end
+ 
+   it "should allow overriding default font for a single instance" do
+--- a/spec/spec_helper.rb
++++ b/spec/spec_helper.rb
+@@ -20,7 +20,6 @@
+ RSpec.configure do |config|
+   config.mock_framework = :mocha
+   config.include EncodingHelpers
+-  config.treat_symbols_as_metadata_keys_with_true_values = true
+ end
+ 
+ def create_pdf(klass=Prawn::Document)
+@@ -32,7 +31,7 @@
+     expect { PDF::Inspector::XObject.analyze(actual.render) }.not_to raise_error
+     true
+   end
+-  failure_message_for_should do |actual|
++  failure_message do |actual|
+     "expected that #{actual}'s XObjects could be successfully parsed"
+   end
+ end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-prawn.git



More information about the Pkg-ruby-extras-commits mailing list