From 1829c2734a43db457d8f243dcb10a441ff6973e8 Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Thu, 19 Sep 2013 23:23:04 +0200 Subject: [PATCH] 'gist' tag: switch to ArgumentError exception class SyntaxError is reserved for Ruby's internal use. Adjust the tests, including the call to liquid to make it rethrow ArgumentErrors. --- lib/jekyll/tags/gist.rb | 2 +- test/test_tags.rb | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/jekyll/tags/gist.rb b/lib/jekyll/tags/gist.rb index 145a41b4..f4f32880 100644 --- a/lib/jekyll/tags/gist.rb +++ b/lib/jekyll/tags/gist.rb @@ -12,7 +12,7 @@ module Jekyll gist_id, filename = tag_contents[0], tag_contents[1] gist_script_tag(gist_id, filename) else - raise SyntaxError.new <<-eos + raise ArgumentError.new <<-eos Syntax error in tag 'gist' while parsing the following markup: #{@markup} diff --git a/test/test_tags.rb b/test/test_tags.rb index 6179077e..fe16faa5 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -19,7 +19,7 @@ class TestTags < Test::Unit::TestCase payload = { "pygments_prefix" => @converter.pygments_prefix, "pygments_suffix" => @converter.pygments_suffix } - @result = Liquid::Template.parse(content).render(payload, info) + @result = Liquid::Template.parse(content).render!(payload, info) @result = @converter.convert(@result) end @@ -273,7 +273,7 @@ CONTENT end end - should "raise SyntaxError when invalid" do + should "raise ArgumentError when invalid" do @gist = "mattr-24081a1d93d2898ecf0f" @filename = "myfile.ext" content = < 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) end end @@ -310,7 +310,7 @@ CONTENT end context "with blank gist id" do - should "raise SyntaxError" do + should "raise ArgumentError" do content = < 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) end end end context "with invalid gist id" do - should "raise SyntaxError" do + should "raise ArgumentError" do invalid_gist = 'invalid' content = < 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) end end