Merge pull request #2216 from szymzet/command-better-coverage

This commit is contained in:
Parker Moore 2014-04-08 09:00:31 -04:00
commit 02c668fa5d
1 changed files with 17 additions and 0 deletions

View File

@ -36,4 +36,21 @@ class TestCommand < Test::Unit::TestCase
end end
end 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 end