creating a Site with an invalid Markdown processor fails sooner and gives a better error message
Signed-off-by: Nick Quaranto <nick@quaran.to>
This commit is contained in:
parent
e0ceee2e89
commit
5468548948
|
@ -1,4 +1,4 @@
|
|||
test/dest/
|
||||
test/dest
|
||||
*.gem
|
||||
pkg/
|
||||
*.swp
|
||||
|
|
|
@ -77,6 +77,8 @@ module Jekyll
|
|||
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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue