spec/spec_helper.rb in squib-0.10.0 vs spec/spec_helper.rb in squib-0.11.0

- old
+ new

@@ -63,10 +63,11 @@ def scrub_hex(str) str.gsub(/0x\w{1,8}/, '') .gsub(/ptr=\w{1,8}/, '') .gsub(/#<Pango::FontDescription:.*>/, '') + .gsub(/#<Pango::AttrList:.*>/, 'Pango::AttrList') .gsub(/#<Cairo::ImageSurface:.*>/, 'ImageSurface') .gsub(/#<Cairo::LinearPattern:.*>/, 'LinearPattern') .gsub(/#<Cairo::RadialPattern:.*>/, 'RadialPattern') .gsub(/#<Cairo::Matrix:.*>/, 'Matrix') .gsub(/#<RSVG::Handle.*>/, 'RSVG::Handle') @@ -101,10 +102,12 @@ allow(pango).to receive(:extents).and_return([Pango::Rectangle.new(0, 0, 0, 0)] * 2) allow(pango).to receive(:iter).and_return(iter) allow(pango).to receive(:alignment).and_return(Pango::Layout::Alignment::LEFT) allow(pango).to receive(:text).and_return('foo') allow(pango).to receive(:context).and_return(pango_cxt) + allow(pango).to receive(:attributes).and_return(nil) + allow(pango_cxt).to receive(:set_shape_renderer) allow(pango_cxt).to receive(:font_options=) allow(iter).to receive(:next_char!).and_return(false) allow(iter).to receive(:char_extents).and_return(Pango::Rectangle.new(5, 5, 5, 5)) allow(iter).to receive(:index).and_return(1000) allow(Pango::FontDescription).to receive(:new).and_return(font) @@ -118,10 +121,11 @@ fill_preserve close_path set_dash set_line_cap set_line_join).each do |m| allow(cxt).to receive(m) { |*args| strio << scrub_hex("cairo: #{m}(#{args})\n") } end %w(font_description= text= width= height= wrap= ellipsize= alignment= - justify= spacing= markup= ellipsized?).each do |m| + justify= spacing= markup= ellipsized? attributes= + set_shape_renderer).each do |m| allow(pango).to receive(m) {|*args| strio << scrub_hex("pango: #{m}(#{args})\n") } end %w(size=).each do |m| allow(font).to receive(m) { |*args| strio << scrub_hex("pango font: #{m}(#{args})\n") }