2020-09-18 23:08:09 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-11-23 16:14:43 +08:00
|
|
|
require "tempfile"
|
2020-11-06 09:00:55 +08:00
|
|
|
require_relative '../test_helper'
|
2020-08-19 22:47:37 +08:00
|
|
|
|
2020-11-23 12:09:16 +08:00
|
|
|
class YouPlotCommandTest < Test::Unit::TestCase
|
2020-11-23 16:14:43 +08:00
|
|
|
def setup
|
|
|
|
@ta = "ta"
|
|
|
|
@stdin = $stdin.dup
|
|
|
|
@stderr = $stderr.dup
|
|
|
|
end
|
|
|
|
|
|
|
|
test :scatter do
|
|
|
|
$stdin = File.open(File.expand_path("../fixtures/iris.csv", __dir__), "r")
|
|
|
|
Tempfile.new("iris-scatter") do |tmp_file|
|
|
|
|
$stderr = tmp_file
|
|
|
|
YouPlot::Command.new(["scatter", "-H", "-d,", "-t", "IRIS"]).run
|
|
|
|
assert_equal File.read(File.expand_path("../fixtures/iris-scatter.txt", __dir__)), tmp_file.read
|
|
|
|
end
|
|
|
|
$stdin = @stdin
|
|
|
|
$stderr = @stderr
|
|
|
|
end
|
2020-08-19 22:47:37 +08:00
|
|
|
end
|