test/test.rb in fkocherga-cmd_line_test-0.1.2 vs test/test.rb in fkocherga-cmd_line_test-0.1.3
- old
+ new
@@ -22,9 +22,28 @@
run_with_options []
end
run_with_options ["--invalid-option"], "running with invalid option" do
assert_failed_run
+ exception_raised = false
+ begin
+ assert_successful_run
+ rescue Exception
+ exception_raised = true
+ end
+ assert(exception_raised)
+ end
+
+ run_with_options ["--raise"], "raise exception" do
+ assert_failed_run
+ exception_raised = false
+ begin
+ assert_successful_run
+ rescue StandardError => error
+ assert error.to_s =~ /CLI exception/
+ exception_raised = true
+ end
+ assert(exception_raised)
end
end
class CliTestNoCommandLineDefined < Test::Unit::TestCase
def test_failure_when_command_line_defined