Add test for unrecognized command

This commit is contained in:
kojix2
2021-01-20 00:57:56 +09:00
parent 8db1306e07
commit 991cf90267
3 changed files with 23 additions and 6 deletions

View File

@@ -138,4 +138,12 @@ class YouPlotCommandTest < Test::Unit::TestCase
assert_equal '', @stderr_file.read
assert_equal fixture('colors.txt'), @stdout_file.read
end
test :unrecognized_command do
assert_raise(YouPlot::Command::Parser::Error) do
YouPlot::Command.new(['abracadabra', '--hadley', '--wickham']).run
end
assert_equal '', @stderr_file.read
assert_equal '', @stdout_file.read
end
end