add test for PGP key yaml frontmatter
This commit is contained in:
parent
823c863a53
commit
6c0f40385c
|
@ -0,0 +1,2 @@
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
|
|
@ -48,6 +48,7 @@ class TestGeneratedSite < Test::Unit::TestCase
|
||||||
should "print a nice list of static files" do
|
should "print a nice list of static files" do
|
||||||
expected_output = Regexp.new <<-OUTPUT
|
expected_output = Regexp.new <<-OUTPUT
|
||||||
- /css/screen.css last edited at \\d+ with extname .css
|
- /css/screen.css last edited at \\d+ with extname .css
|
||||||
|
- /pgp.key last edited at \\d+ with extname .key
|
||||||
- /products.yml last edited at \\d+ with extname .yml
|
- /products.yml last edited at \\d+ with extname .yml
|
||||||
- /symlink-test/symlinked-dir/screen.css last edited at \\d+ with extname .css
|
- /symlink-test/symlinked-dir/screen.css last edited at \\d+ with extname .css
|
||||||
OUTPUT
|
OUTPUT
|
||||||
|
|
|
@ -187,6 +187,16 @@ class TestSite < Test::Unit::TestCase
|
||||||
assert_equal posts.size - @num_invalid_posts, @site.posts.size
|
assert_equal posts.size - @num_invalid_posts, @site.posts.size
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "read pages with yaml front matter" do
|
||||||
|
abs_path = File.expand_path("about.html", @site.source)
|
||||||
|
assert_equal true, @site.send(:has_yaml_header?, abs_path)
|
||||||
|
end
|
||||||
|
|
||||||
|
should "not read PGP keys as pages" do
|
||||||
|
abs_path = File.expand_path("pgp.key", @site.source)
|
||||||
|
assert_equal false, @site.send(:has_yaml_header?, abs_path)
|
||||||
|
end
|
||||||
|
|
||||||
should "expose jekyll version to site payload" do
|
should "expose jekyll version to site payload" do
|
||||||
assert_equal Jekyll::VERSION, @site.site_payload['jekyll']['version']
|
assert_equal Jekyll::VERSION, @site.site_payload['jekyll']['version']
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue