diff --git a/lib/jekyll/tags/link.rb b/lib/jekyll/tags/link.rb index 9ab76167..f81e43b4 100644 --- a/lib/jekyll/tags/link.rb +++ b/lib/jekyll/tags/link.rb @@ -16,11 +16,8 @@ module Jekyll return document.url if document.relative_path == @relative_path end - raise ArgumentError.new <<-eos -Could not find document "#{@relative_path}" in tag '#{TagName}'. - -Make sure the document exists and the path is correct. -eos + raise ArgumentError, "Could not find document '#{@relative_path}' in tag '#{TagName}'.\n\n" \ + "Make sure the document exists and the path is correct." end end end diff --git a/test/test_tags.rb b/test/test_tags.rb index 6d9f7963..84594188 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -11,12 +11,8 @@ class TestTags < JekyllUnitTest def create_post(content, override = {}, converter_class = Jekyll::Converters::Markdown) site = fixture_site({"highlighter" => "rouge"}.merge(override)) - if override['read_posts'] - site.posts.docs.concat(PostReader.new(site).read_posts('')) - end - if override['read_collections'] - CollectionReader.new(site).read - end + site.posts.docs.concat(PostReader.new(site).read_posts('')) if override['read_posts'] + CollectionReader.new(site).read if override['read_collections'] info = { :filters => [Jekyll::Filters], :registers => { :site => site } } @converter = site.converters.find { |c| c.class == converter_class }