spec/integration_spec.rb in prawn-svg-0.22.1 vs spec/integration_spec.rb in prawn-svg-0.23.0
- old
+ new
@@ -3,11 +3,11 @@
describe "Integration test" do
root = "#{File.dirname(__FILE__)}/.."
describe "a basic SVG file" do
let(:document) { Prawn::SVG::Document.new(svg, [800, 600], {}) }
- let(:element) { Prawn::SVG::Elements::Root.new(document, document.root, [], {}) }
+ let(:element) { Prawn::SVG::Elements::Root.new(document) }
let(:svg) do
<<-SVG
<svg width="100" height="200">
<style><![CDATA[
@@ -98,18 +98,19 @@
files.length.should >= 10
end
files.each do |file|
it "renders the #{File.basename file} sample file without warnings or crashing" do
+ expect(Net::HTTP).to_not receive(:get)
+
warnings = nil
Prawn::Document.generate("#{root}/spec/sample_output/#{File.basename file}.pdf") do |prawn|
- r = prawn.svg IO.read(file), :at => [0, prawn.bounds.top], :width => prawn.bounds.width do |doc|
- doc.url_loader.enable_web = false
- doc.url_loader.url_cache["https://raw.githubusercontent.com/mogest/prawn-svg/master/spec/sample_images/mushroom-wide.jpg"] = IO.read("#{root}/spec/sample_images/mushroom-wide.jpg")
- doc.url_loader.url_cache["https://raw.githubusercontent.com/mogest/prawn-svg/master/spec/sample_images/mushroom-long.jpg"] = IO.read("#{root}/spec/sample_images/mushroom-long.jpg")
+ r = prawn.svg IO.read(file), :at => [0, prawn.bounds.top], :width => prawn.bounds.width, :enable_file_requests_with_root => File.dirname(__FILE__) do |doc|
+ doc.url_loader.add_to_cache("https://raw.githubusercontent.com/mogest/prawn-svg/master/spec/sample_images/mushroom-wide.jpg", IO.read("#{root}/spec/sample_images/mushroom-wide.jpg"))
+ doc.url_loader.add_to_cache("https://raw.githubusercontent.com/mogest/prawn-svg/master/spec/sample_images/mushroom-long.jpg", IO.read("#{root}/spec/sample_images/mushroom-long.jpg"))
end
- warnings = r[:warnings].reject {|w| w =~ /Verdana/ && w =~ /is not a known font/ || w =~ /render gradients$/}
+ warnings = r[:warnings].reject {|w| w =~ /Verdana/ && w =~ /is not a known font/ || w =~ /(render gradients$|waiting on the Prawn project)/}
end
warnings.should == []
end
end
end