tests: Typo fixes.
This commit is contained in:
parent
5e74610755
commit
dbc0349909
|
@ -28,7 +28,7 @@ class TestCollections < JekyllUnitTest
|
|||
assert_equal @collection.label, "methods"
|
||||
end
|
||||
|
||||
should "have default url template" do
|
||||
should "have default URL template" do
|
||||
assert_equal @collection.url_template, "/:collection/:path:output_ext"
|
||||
end
|
||||
|
||||
|
@ -99,7 +99,7 @@ class TestCollections < JekyllUnitTest
|
|||
@collection = @site.collections["methods"]
|
||||
end
|
||||
|
||||
should "have custom url template" do
|
||||
should "have custom URL template" do
|
||||
assert_equal @collection.url_template, "/awesome/:path/"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -99,7 +99,7 @@ class TestCommandsServe < JekyllUnitTest
|
|||
end
|
||||
end
|
||||
|
||||
context "enabling ssl" do
|
||||
context "enabling SSL" do
|
||||
should "raise if enabling without key or cert" do
|
||||
assert_raises RuntimeError do
|
||||
custom_opts({
|
||||
|
|
|
@ -2,7 +2,7 @@ require "helper"
|
|||
require "ostruct"
|
||||
|
||||
class TestConvertible < JekyllUnitTest
|
||||
context "yaml front-matter" do
|
||||
context "YAML front matter" do
|
||||
setup do
|
||||
@convertible = OpenStruct.new(
|
||||
"site" => Site.new(Jekyll.configuration(
|
||||
|
@ -13,17 +13,17 @@ class TestConvertible < JekyllUnitTest
|
|||
@base = File.expand_path("../fixtures", __FILE__)
|
||||
end
|
||||
|
||||
should "parse the front-matter correctly" do
|
||||
should "parse the front matter correctly" do
|
||||
ret = @convertible.read_yaml(@base, "front_matter.erb")
|
||||
assert_equal({ "test" => "good" }, ret)
|
||||
end
|
||||
|
||||
should "not parse if the front-matter is not at the start of the file" do
|
||||
should "not parse if the front matter is not at the start of the file" do
|
||||
ret = @convertible.read_yaml(@base, "broken_front_matter1.erb")
|
||||
assert_equal({}, ret)
|
||||
end
|
||||
|
||||
should "not parse if there is syntax error in front-matter" do
|
||||
should "not parse if there is syntax error in front matter" do
|
||||
name = "broken_front_matter2.erb"
|
||||
out = capture_stderr do
|
||||
ret = @convertible.read_yaml(@base, name)
|
||||
|
@ -33,7 +33,7 @@ class TestConvertible < JekyllUnitTest
|
|||
assert_match(%r!#{File.join(@base, name)}!, out)
|
||||
end
|
||||
|
||||
should "not allow ruby objects in yaml" do
|
||||
should "not allow ruby objects in YAML" do
|
||||
out = capture_stderr do
|
||||
@convertible.read_yaml(@base, "exploit_front_matter.erb")
|
||||
end
|
||||
|
@ -50,14 +50,14 @@ class TestConvertible < JekyllUnitTest
|
|||
assert_match(%r!#{File.join(@base, name)}!, out)
|
||||
end
|
||||
|
||||
should "parse the front-matter but show an error if permalink is empty" do
|
||||
should "parse the front matter but show an error if permalink is empty" do
|
||||
name = "empty_permalink.erb"
|
||||
assert_raises(Errors::InvalidPermalinkError) do
|
||||
@convertible.read_yaml(@base, name)
|
||||
end
|
||||
end
|
||||
|
||||
should "parse the front-matter correctly whitout permalink" do
|
||||
should "parse the front matter correctly without permalink" do
|
||||
out = capture_stderr do
|
||||
@convertible.read_yaml(@base, "front_matter.erb")
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ require "helper"
|
|||
require "jekyll/commands/doctor"
|
||||
|
||||
class TestDoctorCommand < JekyllUnitTest
|
||||
context "urls only differ by case" do
|
||||
context "URLs only differ by case" do
|
||||
setup do
|
||||
clear_dest
|
||||
end
|
||||
|
|
|
@ -36,7 +36,7 @@ class TestDocument < JekyllUnitTest
|
|||
assert_equal "configuration", @document.basename_without_ext
|
||||
end
|
||||
|
||||
should "know whether its a yaml file" do
|
||||
should "know whether it's a YAML file" do
|
||||
assert_equal false, @document.yaml_file?
|
||||
end
|
||||
|
||||
|
@ -110,7 +110,7 @@ class TestDocument < JekyllUnitTest
|
|||
end
|
||||
end
|
||||
|
||||
context "a document as part of a collection with frontmatter defaults" do
|
||||
context "a document as part of a collection with front matter defaults" do
|
||||
setup do
|
||||
@site = fixture_site({
|
||||
"collections" => ["slides"],
|
||||
|
@ -127,14 +127,14 @@ class TestDocument < JekyllUnitTest
|
|||
@document = @site.collections["slides"].docs.select { |d| d.is_a?(Document) }.first
|
||||
end
|
||||
|
||||
should "know the frontmatter defaults" do
|
||||
should "know the front matter defaults" do
|
||||
assert_equal "Example slide", @document.data["title"]
|
||||
assert_equal "slide", @document.data["layout"]
|
||||
assert_equal({ "key"=>"myval" }, @document.data["nested"])
|
||||
end
|
||||
end
|
||||
|
||||
context "a document as part of a collection with overriden default values" do
|
||||
context "a document as part of a collection with overridden default values" do
|
||||
setup do
|
||||
@site = fixture_site({
|
||||
"collections" => ["slides"],
|
||||
|
@ -152,7 +152,7 @@ class TestDocument < JekyllUnitTest
|
|||
@document = @site.collections["slides"].docs[1]
|
||||
end
|
||||
|
||||
should "override default values in the document frontmatter" do
|
||||
should "override default values in the document front matter" do
|
||||
assert_equal "Override title", @document.data["title"]
|
||||
assert_equal "slide", @document.data["layout"]
|
||||
assert_equal(
|
||||
|
@ -179,7 +179,7 @@ class TestDocument < JekyllUnitTest
|
|||
@document = @site.collections["slides"].docs.first
|
||||
end
|
||||
|
||||
should "know the frontmatter defaults" do
|
||||
should "know the front matter defaults" do
|
||||
assert_equal "Example slide", @document.data["title"]
|
||||
assert_equal "slide", @document.data["layout"]
|
||||
assert_equal({ "key"=>"value123" }, @document.data["nested"])
|
||||
|
@ -203,7 +203,7 @@ class TestDocument < JekyllUnitTest
|
|||
@document = @site.collections["slides"].docs.first
|
||||
end
|
||||
|
||||
should "not know the specified frontmatter defaults" do
|
||||
should "not know the specified front matter defaults" do
|
||||
assert_equal "Example slide", @document.data["title"]
|
||||
assert_equal "slide", @document.data["layout"]
|
||||
assert_equal nil, @document.data["nested"]
|
||||
|
|
|
@ -77,7 +77,7 @@ class TestExcerpt < JekyllUnitTest
|
|||
end
|
||||
|
||||
context "#to_liquid" do
|
||||
should "contain the proper page data to mimick the post liquid" do
|
||||
should "contain the proper page data to mimic the post liquid" do
|
||||
assert_equal "Post Excerpt with Layout", @excerpt.to_liquid["title"]
|
||||
url = "/bar/baz/z_category/mixedcase/2013/07/22/post-excerpt-with-layout.html"
|
||||
assert_equal url, @excerpt.to_liquid["url"]
|
||||
|
|
|
@ -151,7 +151,7 @@ class TestFilters < JekyllUnitTest
|
|||
assert_equal "a b", @filter.normalize_whitespace("a \t \n\nb")
|
||||
end
|
||||
|
||||
should "strip whitespace from begining and end of string" do
|
||||
should "strip whitespace from beginning and end of string" do
|
||||
assert_equal "a", @filter.normalize_whitespace("a ")
|
||||
assert_equal "a", @filter.normalize_whitespace(" a")
|
||||
assert_equal "a", @filter.normalize_whitespace(" a ")
|
||||
|
|
|
@ -28,7 +28,7 @@ class TestPage < JekyllUnitTest
|
|||
end
|
||||
|
||||
context "processing pages" do
|
||||
should "create url based on filename" do
|
||||
should "create URL based on filename" do
|
||||
@page = setup_page("contacts.html")
|
||||
assert_equal "/contacts.html", @page.url
|
||||
end
|
||||
|
@ -38,18 +38,18 @@ class TestPage < JekyllUnitTest
|
|||
assert_equal false, @page.published?
|
||||
end
|
||||
|
||||
should "create url with non-alphabetic characters" do
|
||||
should "create URL with non-alphabetic characters" do
|
||||
@page = setup_page("+", "%# +.md")
|
||||
assert_equal "/+/%25%23%20+.html", @page.url
|
||||
end
|
||||
|
||||
context "in a directory hierarchy" do
|
||||
should "create url based on filename" do
|
||||
should "create URL based on filename" do
|
||||
@page = setup_page("/contacts", "bar.html")
|
||||
assert_equal "/contacts/bar.html", @page.url
|
||||
end
|
||||
|
||||
should "create index url based on filename" do
|
||||
should "create index URL based on filename" do
|
||||
@page = setup_page("/contacts", "index.html")
|
||||
assert_equal "/contacts/", @page.url
|
||||
end
|
||||
|
@ -105,7 +105,7 @@ class TestPage < JekyllUnitTest
|
|||
@site.permalink_style = :pretty
|
||||
end
|
||||
|
||||
should "return dir, url, and destination correctly" do
|
||||
should "return dir, URL, and destination correctly" do
|
||||
@page = setup_page("contacts.html")
|
||||
@dest_file = dest_dir("contacts/index.html")
|
||||
|
||||
|
@ -125,7 +125,7 @@ class TestPage < JekyllUnitTest
|
|||
assert_equal "/contacts/bar/", @page.url
|
||||
end
|
||||
|
||||
should "create index url based on filename" do
|
||||
should "create index URL based on filename" do
|
||||
@page = setup_page("/contacts", "index.html")
|
||||
assert_equal "/contacts/", @page.url
|
||||
end
|
||||
|
@ -166,7 +166,7 @@ class TestPage < JekyllUnitTest
|
|||
@site.permalink_style = "/:title/"
|
||||
end
|
||||
|
||||
should "return url and destination correctly" do
|
||||
should "return URL and destination correctly" do
|
||||
@page = setup_page("contacts.html")
|
||||
@dest_file = dest_dir("contacts/index.html")
|
||||
assert_equal "/contacts/", @page.url
|
||||
|
@ -179,7 +179,7 @@ class TestPage < JekyllUnitTest
|
|||
@site.permalink_style = "/:title:output_ext"
|
||||
end
|
||||
|
||||
should "return url and destination correctly" do
|
||||
should "return URL and destination correctly" do
|
||||
@page = setup_page("contacts.html")
|
||||
@dest_file = dest_dir("contacts.html")
|
||||
assert_equal "/contacts.html", @page.url
|
||||
|
@ -192,7 +192,7 @@ class TestPage < JekyllUnitTest
|
|||
@site.permalink_style = "/:title"
|
||||
end
|
||||
|
||||
should "return url and destination correctly" do
|
||||
should "return URL and destination correctly" do
|
||||
@page = setup_page("contacts.html")
|
||||
@dest_file = dest_dir("contacts.html")
|
||||
assert_equal "/contacts", @page.url
|
||||
|
@ -209,7 +209,7 @@ class TestPage < JekyllUnitTest
|
|||
end
|
||||
end
|
||||
|
||||
should "respect permalink in yaml front matter" do
|
||||
should "respect permalink in YAML front matter" do
|
||||
file = "about.html"
|
||||
@page = setup_page(file)
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ class TestRegenerator < JekyllUnitTest
|
|||
assert_equal File.mtime(@path), @regenerator.metadata[@path]["mtime"]
|
||||
end
|
||||
|
||||
should "read legacy yaml metadata" do
|
||||
should "read legacy YAML metadata" do
|
||||
metadata_file = source_dir(".jekyll-metadata")
|
||||
@regenerator = Regenerator.new(@site)
|
||||
|
||||
|
@ -305,7 +305,7 @@ class TestRegenerator < JekyllUnitTest
|
|||
end
|
||||
end
|
||||
|
||||
context "when incremental regen is disabled" do
|
||||
context "when incremental regeneration is disabled" do
|
||||
setup do
|
||||
FileUtils.rm_rf(source_dir(".jekyll-metadata"))
|
||||
@site = Site.new(Jekyll.configuration({
|
||||
|
|
|
@ -18,7 +18,7 @@ class TestRelatedPosts < JekyllUnitTest
|
|||
end
|
||||
end
|
||||
|
||||
context "building related posts with lsi" do
|
||||
context "building related posts with LSI" do
|
||||
setup do
|
||||
if jruby?
|
||||
skip(
|
||||
|
@ -53,7 +53,7 @@ class TestRelatedPosts < JekyllUnitTest
|
|||
Jekyll::RelatedPosts.new(post).build
|
||||
end
|
||||
|
||||
should "use lsi for the related posts" do
|
||||
should "use LSI for the related posts" do
|
||||
allow_any_instance_of(::ClassifierReborn::LSI).to \
|
||||
receive(:find_related).and_return(@site.posts[-1..-9])
|
||||
allow_any_instance_of(::ClassifierReborn::LSI).to receive(:build_index)
|
||||
|
|
|
@ -210,12 +210,12 @@ class TestSite < JekyllUnitTest
|
|||
assert_equal posts.size - @num_invalid_posts, @site.posts.size
|
||||
end
|
||||
|
||||
should "read pages with yaml front matter" do
|
||||
should "read pages with YAML front matter" do
|
||||
abs_path = File.expand_path("about.html", @site.source)
|
||||
assert_equal true, Utils.has_yaml_header?(abs_path)
|
||||
end
|
||||
|
||||
should "enforce a strict 3-dash limit on the start of the YAML front-matter" do
|
||||
should "enforce a strict 3-dash limit on the start of the YAML front matter" do
|
||||
abs_path = File.expand_path("pgp.key", @site.source)
|
||||
assert_equal false, Utils.has_yaml_header?(abs_path)
|
||||
end
|
||||
|
@ -330,7 +330,7 @@ class TestSite < JekyllUnitTest
|
|||
s = Site.new(site_configuration("markdown" => custom_processor))
|
||||
s.process
|
||||
|
||||
# Do some cleanup, we don't like straggling stuff's.
|
||||
# Do some cleanup, we don't like straggling stuff.
|
||||
Jekyll::Converters::Markdown.send(:remove_const, :CustomMarkdown)
|
||||
end
|
||||
|
||||
|
@ -356,7 +356,7 @@ class TestSite < JekyllUnitTest
|
|||
s.process
|
||||
end
|
||||
|
||||
# Do some cleanup, we don't like straggling stuff's.
|
||||
# Do some cleanup, we don't like straggling stuff.
|
||||
Jekyll::Converters::Markdown.send(:remove_const, :Custom)
|
||||
end
|
||||
end
|
||||
|
@ -544,7 +544,7 @@ class TestSite < JekyllUnitTest
|
|||
assert_equal mtime3, mtime4 # no modifications, so remain the same
|
||||
end
|
||||
|
||||
should "regnerate files that have had their destination deleted" do
|
||||
should "regenerate files that have had their destination deleted" do
|
||||
contacts_html = @site.pages.find { |p| p.name == "contacts.html" }
|
||||
@site.process
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ class TestStaticFile < JekyllUnitTest
|
|||
assert @static_file.modified?
|
||||
end
|
||||
|
||||
should "known if the source path is modified, when its not" do
|
||||
should "known if the source path is modified, when it's not" do
|
||||
@static_file.write(dest_dir)
|
||||
sleep 1 # wait, else the times are still the same
|
||||
assert !@static_file.modified?
|
||||
|
@ -128,7 +128,7 @@ class TestStaticFile < JekyllUnitTest
|
|||
assert @static_file.write?, "always true, with current implementation"
|
||||
end
|
||||
|
||||
should "be able to write itself to the desitination directory" do
|
||||
should "be able to write itself to the destination directory" do
|
||||
assert @static_file.write(dest_dir)
|
||||
end
|
||||
|
||||
|
|
|
@ -547,7 +547,7 @@ CONTENT
|
|||
refute_match(%r!markdown\-html\-error!, @result)
|
||||
end
|
||||
|
||||
should "have the url to the \"complex\" post from 2008-11-21" do
|
||||
should "have the URL to the \"complex\" post from 2008-11-21" do
|
||||
assert_match %r!/2008/11/21/complex/!, @result
|
||||
end
|
||||
end
|
||||
|
@ -576,12 +576,12 @@ CONTENT
|
|||
refute_match(%r!markdown\-html\-error!, @result)
|
||||
end
|
||||
|
||||
should "have the url to the \"complex\" post from 2008-11-21" do
|
||||
should "have the URL to the \"complex\" post from 2008-11-21" do
|
||||
assert_match %r!1\s/2008/11/21/complex/!, @result
|
||||
assert_match %r!2\s/2008/11/21/complex/!, @result
|
||||
end
|
||||
|
||||
should "have the url to the \"nested\" post from 2008-11-21" do
|
||||
should "have the URL to the \"nested\" post from 2008-11-21" do
|
||||
assert_match %r!3\s/2008/11/21/nested/!, @result
|
||||
assert_match %r!4\s/2008/11/21/nested/!, @result
|
||||
end
|
||||
|
@ -648,7 +648,7 @@ CONTENT
|
|||
refute_match(%r!markdown\-html\-error!, @result)
|
||||
end
|
||||
|
||||
should "have the url to the \"yaml_with_dots\" item" do
|
||||
should "have the URL to the \"yaml_with_dots\" item" do
|
||||
assert_match(%r!/methods/yaml_with_dots\.html!, @result)
|
||||
end
|
||||
end
|
||||
|
@ -675,11 +675,11 @@ CONTENT
|
|||
refute_match(%r!markdown\-html\-error!, @result)
|
||||
end
|
||||
|
||||
should "have the url to the \"sanitized_path\" item" do
|
||||
should "have the URL to the \"sanitized_path\" item" do
|
||||
assert_match %r!1\s/methods/sanitized_path\.html!, @result
|
||||
end
|
||||
|
||||
should "have the url to the \"site/generate\" item" do
|
||||
should "have the URL to the \"site/generate\" item" do
|
||||
assert_match %r!2\s/methods/site/generate\.html!, @result
|
||||
end
|
||||
end
|
||||
|
|
|
@ -356,12 +356,12 @@ class TestUtils < JekyllUnitTest
|
|||
end
|
||||
|
||||
context "The \`Utils.has_yaml_header?\` method" do
|
||||
should "accept files with yaml front matter" do
|
||||
should "accept files with YAML front matter" do
|
||||
file = source_dir("_posts", "2008-10-18-foo-bar.markdown")
|
||||
assert_equal "---\n", File.open(file, "rb") { |f| f.read(4) }
|
||||
assert Utils.has_yaml_header?(file)
|
||||
end
|
||||
should "accept files with extraneous spaces after yaml front matter" do
|
||||
should "accept files with extraneous spaces after YAML front matter" do
|
||||
file = source_dir("_posts", "2015-12-27-extra-spaces.markdown")
|
||||
assert_equal "--- \n", File.open(file, "rb") { |f| f.read(6) }
|
||||
assert Utils.has_yaml_header?(file)
|
||||
|
|
Loading…
Reference in New Issue