File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 7
7
SPEC_ROOT = File . dirname ( __FILE__ ) + "/"
8
8
TEMP_DIR = SPEC_ROOT + "temp/"
9
9
FIXTURES_DIR = SPEC_ROOT + "fixtures/"
10
+ display_img = nil
10
11
11
12
backend = ENV [ 'RUBYPLOT_BACKEND' ]
12
13
@@ -50,9 +51,21 @@ def compare_with_reference(test_image, reference_image)
50
51
config . before ( :suite ) do
51
52
FileUtils . mkdir_p TEMP_DIR
52
53
FileUtils . mkdir_p FIXTURES_DIR
54
+ $stdout. puts 'Do you want to display the image? [y/n]'
55
+ display_img = $stdin. gets . chomp . strip [ 0 ] . downcase
56
+ while display_img != "y" && display_img != "n"
57
+ $stdout. puts 'Please enter y or n'
58
+ display_img = $stdin. gets . chomp . strip [ 0 ] . downcase
59
+ end
60
+ if display_img == "y"
61
+ display_img = true
62
+ else
63
+ display_img = false
64
+ end
53
65
end
54
-
55
- config . after ( :example ) do |example |
66
+
67
+ config . after ( :example ) do |example |
68
+ @figure . show if display_img
56
69
if @figure . is_a? ( Rubyplot ::Artist ::Figure )
57
70
plot_name = example . description . split . join ( "_" ) + ".png"
58
71
base_image = TEMP_DIR + plot_name
You can’t perform that action at this time.
0 commit comments