File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 39
39
end
40
40
41
41
context "when fill_and_stroke is issued" do
42
+ def expect_rectangle
43
+ if RUBY_VERSION . start_with? ( "2.7." )
44
+ expect ( prawn ) . to receive ( :rectangle )
45
+ else
46
+ expect ( prawn ) . to receive ( :rectangle ) . with ( [ 0 , 100 ] , 10 , 10 )
47
+ end
48
+ end
49
+
42
50
context "and fill rule is not set" do
43
51
let ( :interface ) { Prawn ::SVG ::Interface . new ( '<svg width="250" height="100"><rect width="10" height="10" stroke="red"></rect></svg>' , prawn , { } ) }
44
52
45
53
it "adds content 'B'" do
46
- expect ( prawn ) . to receive ( :rectangle ) . with ( [ 0 , 100 ] , 10 , 10 )
54
+ expect_rectangle
47
55
expect ( prawn ) . to receive ( :add_content ) . with ( "W n" )
48
56
expect ( prawn ) . to receive ( :add_content ) . with ( "B" )
49
57
interface . draw
54
62
let ( :interface ) { Prawn ::SVG ::Interface . new ( '<svg width="250" height="100"><rect width="10" height="10" stroke="red" fill-rule="evenodd"></rect></svg>' , prawn , { } ) }
55
63
56
64
it "adds content 'B*'" do
57
- expect ( prawn ) . to receive ( :rectangle ) . with ( [ 0 , 100 ] , 10 , 10 )
65
+ expect_rectangle
58
66
expect ( prawn ) . to receive ( :add_content ) . with ( "W n" )
59
67
expect ( prawn ) . to receive ( :add_content ) . with ( "B*" )
60
68
interface . draw
You can’t perform that action at this time.
0 commit comments