Clean up Tags::PostUrl a bit

This commit is contained in:
Parker Moore
2016-03-15 16:06:25 -07:00
parent 329878c45f
commit 97efa0f0ce
5 changed files with 54 additions and 15 deletions

View File

@@ -95,20 +95,20 @@ class TestUtils < JekyllUnitTest
end
should "throw an error if the input contains no date data" do
assert_raises Jekyll::Errors::FatalException do
assert_raises Jekyll::Errors::InvalidDateError do
Utils.parse_date("Blah")
end
end
should "throw an error if the input is out of range" do
assert_raises Jekyll::Errors::FatalException do
assert_raises Jekyll::Errors::InvalidDateError do
Utils.parse_date("9999-99-99")
end
end
should "throw an error with the default message if no message is passed in" do
date = "Blah this is invalid"
assert_raises Jekyll::Errors::FatalException, "Invalid date '#{date}': Input could not be parsed." do
assert_raises Jekyll::Errors::InvalidDateError, "Invalid date '#{date}': Input could not be parsed." do
Utils.parse_date(date)
end
end
@@ -116,7 +116,7 @@ class TestUtils < JekyllUnitTest
should "throw an error with the provided message if a message is passed in" do
date = "Blah this is invalid"
message = "Aaaah, the world has exploded!"
assert_raises Jekyll::Errors::FatalException, "Invalid date '#{date}': #{message}" do
assert_raises Jekyll::Errors::InvalidDateError, "Invalid date '#{date}': #{message}" do
Utils.parse_date(date, message)
end
end