From 390d75de4688071cc4ce6ddc25c665f4b77effd4 Mon Sep 17 00:00:00 2001 From: Zack Hobson Date: Sat, 30 Nov 2013 08:46:36 -0800 Subject: add tests --- test/app_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/app_test.rb') diff --git a/test/app_test.rb b/test/app_test.rb index 7f7ae28..65e3982 100644 --- a/test/app_test.rb +++ b/test/app_test.rb @@ -29,4 +29,19 @@ class AppTest < Test::Unit::TestCase app.expects(:show).when(throttled.is(true)) app.process_args('show').run end + + def test_report_generic_failure + app = HCl::App.new + app.expects(:show).raises(RuntimeError) + app.expects(:exit).with(1) + app.process_args('show').run + end + + def test_report_socket_error + app = HCl::App.new + app.expects(:show).raises(SocketError) + app.expects(:exit).with(1) + app.process_args('show').run + end + end -- cgit v1.2.3