Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

creating a Site with an invalid Markdown processor fails sooner and g…

…ives a better error message

Signed-off-by: Nick Quaranto <nick@quaran.to>
  • Loading branch information...
commit 5468548948111f49ba1cc95e194cbc4ffcfc5931 1 parent e0ceee2
@jamesarosen jamesarosen authored qrush committed
Showing with 19 additions and 1 deletion.
  1. +1 −1  .gitignore
  2. +2 −0  lib/jekyll/site.rb
  3. +16 −0 test/test_site.rb
View
2  .gitignore
@@ -1,4 +1,4 @@
-test/dest/
+test/dest
*.gem
pkg/
*.swp
View
2  lib/jekyll/site.rb
@@ -77,6 +77,8 @@ def markdown(content)
rescue LoadError
puts "The maruku gem is required for markdown support!"
end
+ else
+ raise "Invalid Markdown processor: '#{self.config['markdown']}' -- did you mean 'maruku' or 'rdiscount'?"
end
end
View
16 test/test_site.rb
@@ -65,5 +65,21 @@ class TestSite < Test::Unit::TestCase
@site.exclude = excludes
assert_equal includes, @site.filter_entries(excludes + includes)
end
+
+ context 'with an invalid markdown processor in the configuration' do
+
+ should 'give a meaningful error message' do
+ bad_processor = 'not a processor name'
+ begin
+ Site.new(Jekyll.configuration.merge({ 'markdown' => bad_processor }))
+ flunk 'Invalid markdown processors should cause a failure on site creation'
+ rescue RuntimeError => e
+ assert e.to_s =~ /invalid|bad/i
+ assert e.to_s =~ %r{#{bad_processor}}
+ end
+ end
+
+ end
+
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.