spec/prawn/svg/css/stylesheets_spec.rb in prawn-svg-0.34.1 vs spec/prawn/svg/css/stylesheets_spec.rb in prawn-svg-0.34.2
- old
+ new
@@ -60,10 +60,11 @@
it "associates styles with elements" do
result = Prawn::SVG::CSS::Stylesheets.new(CssParser::Parser.new, REXML::Document.new(svg)).load
width_and_styles = result.map { |k, v| [k.attributes["width"].to_i, v] }.sort_by(&:first)
expected = [
+ [0, [["overflow", "hidden", false]]],
[1, [["fill", "#ff0000", false]]],
[2, [["fill", "#ff0000", false], ["fill", "#330000", false], ["fill", "#440000", false], ["fill", "#220000", false]]],
[3, [["fill", "#ff0000", false], ["fill", "#00ff00", false]]],
[4, [["fill", "#ff0000", false], ["fill", "#330000", false], ["fill", "#440000", false], ["fill", "#00ff00", false]]],
]
@@ -112,9 +113,10 @@
end
it "scans the document for style tags and adds the style information to the css parser" do
css_parser = instance_double(CssParser::Parser)
+ expect(css_parser).to receive(:add_block!).with("svg, symbol, image, marker, pattern, foreignObject { overflow: hidden }")
expect(css_parser).to receive(:add_block!).with("a\n before>\n x y\n inside <>>\n k j\n after\nz")
expect(css_parser).to receive(:add_block!).with("hello")
allow(css_parser).to receive(:each_rule_set)
Prawn::SVG::CSS::Stylesheets.new(css_parser, REXML::Document.new(svg)).load