Add test to ensure plugins are executed in order of priority.

This commit is contained in:
Tommy Sullivan 2013-03-16 15:12:30 +01:00 committed by Parker Moore
parent b49bba9351
commit 7425b2c32e
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,8 @@
module Jekyll
class Dummy < Generator
priority :high
def generate(site)
end
end
end

View File

@ -124,6 +124,11 @@ class TestSite < Test::Unit::TestCase
assert_equal mtime3, mtime4 # no modifications, so must be the same
end
should "setup plugins in priority order" do
assert_equal @site.converters.sort_by(&:class).map{|c|c.class.priority}, @site.converters.map{|c|c.class.priority}
assert_equal @site.generators.sort_by(&:class).map{|g|g.class.priority}, @site.generators.map{|g|g.class.priority}
end
should "read layouts" do
@site.read_layouts
assert_equal ["default", "simple"].sort, @site.layouts.keys.sort