spec/prawn/svg/attributes/font_spec.rb in prawn-svg-0.22.1 vs spec/prawn/svg/attributes/font_spec.rb in prawn-svg-0.23.0

- old
+ new

@@ -2,19 +2,22 @@ describe Prawn::SVG::Attributes::Font do class FontTestElement include Prawn::SVG::Attributes::Font - attr_accessor :attributes, :warnings + attr_accessor :attributes, :warnings, :state, :document - def initialize - @state = {} + def initialize(document) + @state = Prawn::SVG::State.new + @document = document @warnings = [] end end - let(:element) { FontTestElement.new } - let(:document) { double(fallback_font_name: "Times-Roman") } + let(:pdf) { Prawn::Document.new } + let(:font_registry) { Prawn::SVG::FontRegistry.new(pdf.font_families) } + let(:document) { double(fallback_font_name: "Times-Roman", font_registry: font_registry) } + let(:element) { FontTestElement.new(document) } before do allow(element).to receive(:document).and_return(document) element.attributes = {"font-family" => family} end