Skip to content

Commit f824135

Browse files
committed
Clarify the Output type a little
1 parent 2eca862 commit f824135

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/youplot/command.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ def output_data(input)
182182

183183
def output_plot(plot)
184184
case options[:output]
185-
when IO
185+
when IO, StringIO
186186
plot.render(options[:output])
187-
else
187+
when String, Tempfile
188188
File.open(options[:output], 'w') do |f|
189189
plot.render(f)
190190
end
@@ -193,7 +193,7 @@ def output_plot(plot)
193193

194194
def output_plot_progressive(plot)
195195
case options[:output]
196-
when IO
196+
when IO, StringIO
197197
# RefactorMe
198198
out = StringIO.new(String.new)
199199
def out.tty?

test/youplot/iris_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def setup
2828

2929
def teardown
3030
@stderr_file.close
31+
@stdout_file.close
3132
end
3233

3334
def fixture(fname)

test/youplot/simple_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def setup
2828

2929
def teardown
3030
@stderr_file.close
31+
@stdout_file.close
3132
end
3233

3334
def fixture(fname)

0 commit comments

Comments
 (0)