From 89b3bec1b0c7b78ba7b4efb4998dc08cf54a2435 Mon Sep 17 00:00:00 2001 From: szymzet Date: Tue, 8 Apr 2014 11:32:53 +0200 Subject: [PATCH] Add missing Command tests --- test/test_command.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/test_command.rb b/test/test_command.rb index 860c0c3d..ef5b04b0 100644 --- a/test/test_command.rb +++ b/test/test_command.rb @@ -36,4 +36,21 @@ class TestCommand < Test::Unit::TestCase end end end + context "when calling .add_build_options" do + should "add common options" do + cmd = Object.new + mock(cmd).option.with_any_args.at_least(1) + Command.add_build_options(cmd) + end + end + context "when calling .process_site" do + context "when fatal error occurs" do + should "exit with non-zero error code" do + site = Object.new + stub(site).process { raise Jekyll::FatalException } + error = assert_raise(SystemExit) { Command.process_site(site) } + assert_not_equal 0, error.status + end + end + end end