forked from sverrirs/jekyll-paginate-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow using :xxx_name in autopage titles (fixes sverrirs#225).
- Loading branch information
1 parent
e4e1d01
commit be5bb89
Showing
7 changed files
with
68 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require_relative '../spec_helper.rb' | ||
|
||
module Jekyll::PaginateV2::AutoPages | ||
describe Utils do | ||
|
||
describe "expand_placeholders" do | ||
it "should return string unmodified when no placeholders are present" do | ||
Utils.expand_placeholders("hello world", {}).must_equal "hello world" | ||
Utils.expand_placeholders("hello world", { ":foo" => "bar" }).must_equal "hello world" | ||
end | ||
|
||
it "should replace placeholders in the string" do | ||
Utils.expand_placeholders("xyz:foo:bar:foo", { ":foo" => "abc", ":bar" => "def" }).must_equal "xyzabcdefabc" | ||
Utils.expand_placeholders("xyz:foo:foobar:foo", { ":foo" => "abc", ":foobar" => "def" }).must_equal "xyzabcdefabc" | ||
end | ||
|
||
it "should not replace placeholders inside replacements" do | ||
Utils.expand_placeholders(":foo:bar:foo", { ":foo" => ":bar", ":bar" => ":foo" }).must_equal ":bar:foo:bar" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters