From 1bb2259a103edcfb16a0886afb26f2ee99a9fb62 Mon Sep 17 00:00:00 2001 From: fen Date: Wed, 2 Nov 2016 00:00:38 +0100 Subject: [PATCH] add failing test --- test/test_url.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/test_url.rb b/test/test_url.rb index f5a77622f..5f9839094 100644 --- a/test/test_url.rb +++ b/test/test_url.rb @@ -80,5 +80,26 @@ class TestURL < JekyllUnitTest url.to_s end end + + should "ignore NoMethodErrors when a placeholder is not found" do + site = fixture_site({ + "collections" => { + "methods" => { + "output" => true + } + } + }) + site.read + matching_doc = site.collections["methods"].docs.find do |doc| + doc.relative_path == "_methods/escape-+ #%20[].md" + end + out, err = capture_io do + URL.new( + :template => "/methods/:title/:headline", + :placeholders => matching_doc.url_placeholders + ).to_s + end + assert out.include? ":headline is not defined!" + end end end