From bcfd3e1fceef725b1892d541c1ee707b13374d5e Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Tue, 23 Oct 2018 15:54:25 +0200 Subject: [PATCH 1/5] style: Style/RegexpLiteral Use %r around regular expression --- spec/jekyll-feed_spec.rb | 64 ++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/spec/jekyll-feed_spec.rb b/spec/jekyll-feed_spec.rb index e042c425..03bd2642 100644 --- a/spec/jekyll-feed_spec.rb +++ b/spec/jekyll-feed_spec.rb @@ -43,16 +43,16 @@ end it "puts all the posts in the feed.xml file" do - expect(contents).to match /http:\/\/example\.org\/updates\/2014\/03\/04\/march-the-fourth\.html/ - expect(contents).to match /http:\/\/example\.org\/news\/2014\/03\/02\/march-the-second\.html/ - expect(contents).to match /http:\/\/example\.org\/news\/2013\/12\/12\/dec-the-second\.html/ + expect(contents).to match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! + expect(contents).to match %r!http://example.org/news/2014/03/02/march-the-second.html! + expect(contents).to match %r!http://example.org/news/2013/12/12/dec-the-second.html! expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html" - expect(contents).to_not match /http:\/\/example\.org\/2016\/02\/09\/a-draft\.html/ + expect(contents).to_not match %r!http://example.org/2016/02/09/a-draft.html! end it "does not include assets or any static files that aren't .html" do - expect(contents).not_to match /http:\/\/example\.org\/images\/hubot\.png/ - expect(contents).not_to match /http:\/\/example\.org\/feeds\/atom\.xml/ + expect(contents).not_to match %r!http://example.org/images/hubot.png! + expect(contents).not_to match %r!http://example.org/feeds/atom.xml! end it "preserves linebreaks in preformatted text in posts" do @@ -60,27 +60,27 @@ end it "supports post author name as an object" do - expect(contents).to match /\s*Ben<\/name>\s*ben@example.com<\/email>\s*http:\/\/ben.balter.com<\/uri>\s*<\/author>/ + expect(contents).to match %r!\s*Ben\s*ben@example.com\s*http://ben.balter.com\s*! end it "supports post author name as a string" do - expect(contents).to match /\s*Pat<\/name>\s*<\/author>/ + expect(contents).to match %r!\s*Pat\s*! end it "does not output author tag no author is provided" do - expect(contents).not_to match /\s*<\/name>\s*<\/author>/ + expect(contents).not_to match %r!\s*\s*! end it "does use author reference with data from _data/authors.yml" do - expect(contents).to match /\s*Garth<\/name>\s*example@mail.com<\/email>\s*http:\/\/garthdb.com<\/uri>\s*<\/author>/ + expect(contents).to match %r!\s*Garth\s*example@mail.com\s*http://garthdb.com\s*! end it "converts markdown posts to HTML" do - expect(contents).to match /<p>March the second!<\/p>/ + expect(contents).to match %r!<p>March the second\!</p>! end it "uses last_modified_at where available" do - expect(contents).to match /2015-05-12T13:27:59\+00:00<\/updated>/ + expect(contents).to match %r!2015-05-12T13:27:59\+00:00! end it "replaces newlines in posts to spaces" do @@ -239,9 +239,9 @@ end it "correctly adds the baseurl to the posts" do - expect(contents).to match /http:\/\/example\.org\/bass\/updates\/2014\/03\/04\/march-the-fourth\.html/ - expect(contents).to match /http:\/\/example\.org\/bass\/news\/2014\/03\/02\/march-the-second\.html/ - expect(contents).to match /http:\/\/example\.org\/bass\/news\/2013\/12\/12\/dec-the-second\.html/ + expect(contents).to match %r!http://example.org/bass/updates/2014/03/04/march-the-fourth.html! + expect(contents).to match %r!http://example.org/bass/news/2014/03/02/march-the-second.html! + expect(contents).to match %r!http://example.org/bass/news/2013/12/12/dec-the-second.html! end it "renders the feed meta" do @@ -344,18 +344,18 @@ let(:news_feed) { File.read(dest_dir("feed/news.xml")) } it "outputs the primary feed" do - expect(contents).to match /http:\/\/example\.org\/updates\/2014\/03\/04\/march-the-fourth\.html/ - expect(contents).to match /http:\/\/example\.org\/news\/2014\/03\/02\/march-the-second\.html/ - expect(contents).to match /http:\/\/example\.org\/news\/2013\/12\/12\/dec-the-second\.html/ + expect(contents).to match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! + expect(contents).to match %r!http://example.org/news/2014/03/02/march-the-second.html! + expect(contents).to match %r!http://example.org/news/2013/12/12/dec-the-second.html! expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html" - expect(contents).to_not match /http:\/\/example\.org\/2016\/02\/09\/a-draft\.html/ + expect(contents).to_not match %r!http://example.org/2016/02/09/a-draft.html! end it "outputs the category feed" do expect(news_feed).to match "My awesome site | News" - expect(news_feed).to match /http:\/\/example\.org\/news\/2014\/03\/02\/march-the-second\.html/ - expect(news_feed).to match /http:\/\/example\.org\/news\/2013\/12\/12\/dec-the-second\.html/ - expect(news_feed).to_not match /http:\/\/example\.org\/updates\/2014\/03\/04\/march-the-fourth\.html/ + expect(news_feed).to match %r!http://example.org/news/2014/03/02/march-the-second.html! + expect(news_feed).to match %r!http://example.org/news/2013/12/12/dec-the-second.html! + expect(news_feed).to_not match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" end end @@ -375,18 +375,18 @@ let(:news_feed) { File.read(dest_dir("feed/news.xml")) } it "outputs the primary feed" do - expect(contents).to match /http:\/\/example\.org\/updates\/2014\/03\/04\/march-the-fourth\.html/ - expect(contents).to match /http:\/\/example\.org\/news\/2014\/03\/02\/march-the-second\.html/ - expect(contents).to match /http:\/\/example\.org\/news\/2013\/12\/12\/dec-the-second\.html/ + expect(contents).to match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! + expect(contents).to match %r!http://example.org/news/2014/03/02/march-the-second.html! + expect(contents).to match %r!http://example.org/news/2013/12/12/dec-the-second.html! expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html" - expect(contents).to_not match /http:\/\/example\.org\/2016\/02\/09\/a-draft\.html/ + expect(contents).to_not match %r!http://example.org/2016/02/09/a-draft.html! end it "outputs the category feed" do expect(news_feed).to match "My awesome site | News" - expect(news_feed).to match /http:\/\/example\.org\/news\/2014\/03\/02\/march-the-second\.html/ - expect(news_feed).to match /http:\/\/example\.org\/news\/2013\/12\/12\/dec-the-second\.html/ - expect(news_feed).to_not match /http:\/\/example\.org\/updates\/2014\/03\/04\/march-the-fourth\.html/ + expect(news_feed).to match %r!http://example.org/news/2014/03/02/march-the-second.html! + expect(news_feed).to match %r!http://example.org/news/2013/12/12/dec-the-second.html! + expect(news_feed).to_not match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" end end @@ -403,7 +403,7 @@ "output" => true } }, - "feed" => { "collections" => ["collection"] } + "feed" => { "collections" => ["collection"] } } } @@ -412,7 +412,7 @@ expect(collection_feed).to match "My awesome site | Collection" expect(collection_feed).to match "http://example.org/collection/2018-01-01-collection-doc.html" expect(collection_feed).to match "http://example.org/collection/2018-01-02-collection-category-doc.html" - expect(collection_feed).to_not match /http:\/\/example\.org\/updates\/2014\/03\/04\/march-the-fourth\.html/ + expect(collection_feed).to_not match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! expect(collection_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" end end @@ -440,7 +440,7 @@ expect(news_feed).to match "My awesome site | Collection | News" expect(news_feed).to match "http://example.org/collection/2018-01-02-collection-category-doc.html" expect(news_feed).to_not match "http://example.org/collection/2018-01-01-collection-doc.html" - expect(news_feed).to_not match /http:\/\/example\.org\/updates\/2014\/03\/04\/march-the-fourth\.html/ + expect(news_feed).to_not match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" end end From 617c6fd3026fa965cf2bae03a5ef586f807d7ffa Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Tue, 23 Oct 2018 16:11:15 +0200 Subject: [PATCH 2/5] style: rubocop autocorrect --- spec/jekyll-feed_spec.rb | 77 ++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/spec/jekyll-feed_spec.rb b/spec/jekyll-feed_spec.rb index 03bd2642..d153df4a 100644 --- a/spec/jekyll-feed_spec.rb +++ b/spec/jekyll-feed_spec.rb @@ -258,11 +258,11 @@ context "with a blank site name" do let(:config) do - Jekyll.configuration({ + Jekyll.configuration( "source" => source_dir, "destination" => dest_dir, - "url" => "http://example.org", - }) + "url" => "http://example.org" + ) end it "does not output blank title" do @@ -296,9 +296,9 @@ "feed" => { "collections" => { "posts" => { - "path" => "atom.xml" - } - } + "path" => "atom.xml", + }, + }, }, } end @@ -336,11 +336,11 @@ context "categories" do context "with top-level post categories" do - let(:overrides) { + let(:overrides) do { - "feed" => { "categories" => ["news"] } + "feed" => { "categories" => ["news"] }, } - } + end let(:news_feed) { File.read(dest_dir("feed/news.xml")) } it "outputs the primary feed" do @@ -361,17 +361,17 @@ end context "with collection-level post categories" do - let(:overrides) { + let(:overrides) do { "feed" => { "collections" => { "posts" => { - "categories" => ["news"] - } - } - } + "categories" => ["news"], + }, + }, + }, } - } + end let(:news_feed) { File.read(dest_dir("feed/news.xml")) } it "outputs the primary feed" do @@ -396,17 +396,16 @@ let(:collection_feed) { File.read(dest_dir("feed/collection.xml")) } context "when initialized as an array" do - let(:overrides) { + let(:overrides) do { "collections" => { "collection" => { - "output" => true - } + "output" => true, + }, }, - "feed" => { "collections" => ["collection"] } + "feed" => { "collections" => ["collection"] }, } - } - + end it "outputs the collection feed" do expect(collection_feed).to match "My awesome site | Collection" @@ -418,22 +417,22 @@ end context "with categories" do - let(:overrides) { + let(:overrides) do { "collections" => { "collection" => { - "output" => true - } + "output" => true, + }, }, - "feed" => { + "feed" => { "collections" => { "collection" => { - "categories" => ["news"] - } - } - } + "categories" => ["news"], + }, + }, + }, } - } + end let(:news_feed) { File.read(dest_dir("feed/collection/news.xml")) } it "outputs the collection category feed" do @@ -446,23 +445,23 @@ end context "with a custom path" do - let(:overrides) { + let(:overrides) do { "collections" => { "collection" => { - "output" => true - } + "output" => true, + }, }, - "feed" => { + "feed" => { "collections" => { "collection" => { "categories" => ["news"], - "path" => "custom.xml" - } - } - } + "path" => "custom.xml", + }, + }, + }, } - } + end it "should write to the custom path" do expect(Pathname.new(dest_dir("custom.xml"))).to exist From 60f001a0f1694478533bac1c52a063c31ff492cf Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Tue, 23 Oct 2018 16:15:20 +0200 Subject: [PATCH 3/5] chore(config): remove useless folders --- .rubocop.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 1538636a..c2504a32 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -19,10 +19,7 @@ AllCops: - LICENSE.txt - README.md - - features/**/* - script/**/* - - spec/**/* - - test/**/* - vendor/**/* Naming/MemoizedInstanceVariableName: From 1b161c76ab34c273444713a7641ea81530f778f6 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Tue, 23 Oct 2018 18:27:11 +0200 Subject: [PATCH 4/5] test: escape dots --- spec/jekyll-feed_spec.rb | 58 ++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/spec/jekyll-feed_spec.rb b/spec/jekyll-feed_spec.rb index d153df4a..845c54f1 100644 --- a/spec/jekyll-feed_spec.rb +++ b/spec/jekyll-feed_spec.rb @@ -43,16 +43,16 @@ end it "puts all the posts in the feed.xml file" do - expect(contents).to match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! - expect(contents).to match %r!http://example.org/news/2014/03/02/march-the-second.html! - expect(contents).to match %r!http://example.org/news/2013/12/12/dec-the-second.html! + expect(contents).to match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! + expect(contents).to match %r!http://example\.org/news/2014/03/02/march-the-second\.html! + expect(contents).to match %r!http://example\.org/news/2013/12/12/dec-the-second\.html! expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html" - expect(contents).to_not match %r!http://example.org/2016/02/09/a-draft.html! + expect(contents).to_not match %r!http://example\.org/2016/02/09/a-draft\.html! end it "does not include assets or any static files that aren't .html" do - expect(contents).not_to match %r!http://example.org/images/hubot.png! - expect(contents).not_to match %r!http://example.org/feeds/atom.xml! + expect(contents).not_to match %r!http://example\.org/images/hubot\.png! + expect(contents).not_to match %r!http://example\.org/feeds/atom\.xml! end it "preserves linebreaks in preformatted text in posts" do @@ -60,7 +60,7 @@ end it "supports post author name as an object" do - expect(contents).to match %r!\s*Ben\s*ben@example.com\s*http://ben.balter.com\s*! + expect(contents).to match %r!\s*Ben\s*ben@example\.com\s*http://ben\.balter.com\s*! end it "supports post author name as a string" do @@ -72,7 +72,7 @@ end it "does use author reference with data from _data/authors.yml" do - expect(contents).to match %r!\s*Garth\s*example@mail.com\s*http://garthdb.com\s*! + expect(contents).to match %r!\s*Garth\s*example@mail\.com\s*http://garthdb\.com\s*! end it "converts markdown posts to HTML" do @@ -84,7 +84,7 @@ end it "replaces newlines in posts to spaces" do - expect(contents).to match %r!The plugin will properly strip newlines.! + expect(contents).to match %r!The plugin will properly strip newlines\.! end it "renders Liquid inside posts" do @@ -159,7 +159,7 @@ end it "renders the feed meta" do - expected = %r!! + expected = %r!! expect(contents).to match(expected) end end @@ -239,9 +239,9 @@ end it "correctly adds the baseurl to the posts" do - expect(contents).to match %r!http://example.org/bass/updates/2014/03/04/march-the-fourth.html! - expect(contents).to match %r!http://example.org/bass/news/2014/03/02/march-the-second.html! - expect(contents).to match %r!http://example.org/bass/news/2013/12/12/dec-the-second.html! + expect(contents).to match %r!http://example\.org/bass/updates/2014/03/04/march-the-fourth\.html! + expect(contents).to match %r!http://example\.org/bass/news/2014/03/02/march-the-second\.html! + expect(contents).to match %r!http://example\.org/bass/news/2013/12/12/dec-the-second\.html! end it "renders the feed meta" do @@ -344,18 +344,18 @@ let(:news_feed) { File.read(dest_dir("feed/news.xml")) } it "outputs the primary feed" do - expect(contents).to match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! - expect(contents).to match %r!http://example.org/news/2014/03/02/march-the-second.html! - expect(contents).to match %r!http://example.org/news/2013/12/12/dec-the-second.html! + expect(contents).to match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! + expect(contents).to match %r!http://example\.org/news/2014/03/02/march-the-second\.html! + expect(contents).to match %r!http://example\.org/news/2013/12/12/dec-the-second\.html! expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html" - expect(contents).to_not match %r!http://example.org/2016/02/09/a-draft.html! + expect(contents).to_not match %r!http://example\.org/2016/02/09/a-draft\.html! end it "outputs the category feed" do expect(news_feed).to match "My awesome site | News" - expect(news_feed).to match %r!http://example.org/news/2014/03/02/march-the-second.html! - expect(news_feed).to match %r!http://example.org/news/2013/12/12/dec-the-second.html! - expect(news_feed).to_not match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! + expect(news_feed).to match %r!http://example\.org/news/2014/03/02/march-the-second\.html! + expect(news_feed).to match %r!http://example\.org/news/2013/12/12/dec-the-second\.html! + expect(news_feed).to_not match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" end end @@ -375,18 +375,18 @@ let(:news_feed) { File.read(dest_dir("feed/news.xml")) } it "outputs the primary feed" do - expect(contents).to match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! - expect(contents).to match %r!http://example.org/news/2014/03/02/march-the-second.html! - expect(contents).to match %r!http://example.org/news/2013/12/12/dec-the-second.html! + expect(contents).to match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! + expect(contents).to match %r!http://example\.org/news/2014/03/02/march-the-second\.html! + expect(contents).to match %r!http://example\.org/news/2013/12/12/dec-the-second\.html! expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html" - expect(contents).to_not match %r!http://example.org/2016/02/09/a-draft.html! + expect(contents).to_not match %r!http://example\.org/2016/02/09/a-draft\.html! end it "outputs the category feed" do expect(news_feed).to match "My awesome site | News" - expect(news_feed).to match %r!http://example.org/news/2014/03/02/march-the-second.html! - expect(news_feed).to match %r!http://example.org/news/2013/12/12/dec-the-second.html! - expect(news_feed).to_not match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! + expect(news_feed).to match %r!http://example\.org/news/2014/03/02/march-the-second\.html! + expect(news_feed).to match %r!http://example\.org/news/2013/12/12/dec-the-second\.html! + expect(news_feed).to_not match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" end end @@ -411,7 +411,7 @@ expect(collection_feed).to match "My awesome site | Collection" expect(collection_feed).to match "http://example.org/collection/2018-01-01-collection-doc.html" expect(collection_feed).to match "http://example.org/collection/2018-01-02-collection-category-doc.html" - expect(collection_feed).to_not match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! + expect(collection_feed).to_not match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! expect(collection_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" end end @@ -439,7 +439,7 @@ expect(news_feed).to match "My awesome site | Collection | News" expect(news_feed).to match "http://example.org/collection/2018-01-02-collection-category-doc.html" expect(news_feed).to_not match "http://example.org/collection/2018-01-01-collection-doc.html" - expect(news_feed).to_not match %r!http://example.org/updates/2014/03/04/march-the-fourth.html! + expect(news_feed).to_not match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" end end From 84b67b84b97784142259d45d736163e5169b8758 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Tue, 23 Oct 2018 22:53:09 +0530 Subject: [PATCH 5/5] Convert regexps to strings when applicable --- spec/jekyll-feed_spec.rb | 76 ++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/spec/jekyll-feed_spec.rb b/spec/jekyll-feed_spec.rb index 845c54f1..1a8cc5c7 100644 --- a/spec/jekyll-feed_spec.rb +++ b/spec/jekyll-feed_spec.rb @@ -43,24 +43,24 @@ end it "puts all the posts in the feed.xml file" do - expect(contents).to match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! - expect(contents).to match %r!http://example\.org/news/2014/03/02/march-the-second\.html! - expect(contents).to match %r!http://example\.org/news/2013/12/12/dec-the-second\.html! + expect(contents).to match "http://example.org/updates/2014/03/04/march-the-fourth.html" + expect(contents).to match "http://example.org/news/2014/03/02/march-the-second.html" + expect(contents).to match "http://example.org/news/2013/12/12/dec-the-second.html" expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html" - expect(contents).to_not match %r!http://example\.org/2016/02/09/a-draft\.html! + expect(contents).to_not match "http://example.org/2016/02/09/a-draft.html" end it "does not include assets or any static files that aren't .html" do - expect(contents).not_to match %r!http://example\.org/images/hubot\.png! - expect(contents).not_to match %r!http://example\.org/feeds/atom\.xml! + expect(contents).not_to match "http://example.org/images/hubot.png" + expect(contents).not_to match "http://example.org/feeds/atom.xml" end it "preserves linebreaks in preformatted text in posts" do - expect(contents).to match %r!Line 1\nLine 2\nLine 3! + expect(contents).to match "Line 1\nLine 2\nLine 3" end it "supports post author name as an object" do - expect(contents).to match %r!\s*Ben\s*ben@example\.com\s*http://ben\.balter.com\s*! + expect(contents).to match %r!\s*Ben\s*ben@example\.com\s*http://ben\.balter\.com\s*! end it "supports post author name as a string" do @@ -84,12 +84,12 @@ end it "replaces newlines in posts to spaces" do - expect(contents).to match %r!The plugin will properly strip newlines\.! + expect(contents).to match 'The plugin will properly strip newlines.' end it "renders Liquid inside posts" do - expect(contents).to match %r!Liquid is rendered\.! - expect(contents).not_to match %r!Liquid is not rendered\.! + expect(contents).to match "Liquid is rendered." + expect(contents).not_to match "Liquid is not rendered." end it "includes the item image" do @@ -159,7 +159,7 @@ end it "renders the feed meta" do - expected = %r!! + expected = %r!! expect(contents).to match(expected) end end @@ -239,9 +239,9 @@ end it "correctly adds the baseurl to the posts" do - expect(contents).to match %r!http://example\.org/bass/updates/2014/03/04/march-the-fourth\.html! - expect(contents).to match %r!http://example\.org/bass/news/2014/03/02/march-the-second\.html! - expect(contents).to match %r!http://example\.org/bass/news/2013/12/12/dec-the-second\.html! + expect(contents).to match "http://example.org/bass/updates/2014/03/04/march-the-fourth.html" + expect(contents).to match "http://example.org/bass/news/2014/03/02/march-the-second.html" + expect(contents).to match "http://example.org/bass/news/2013/12/12/dec-the-second.html" end it "renders the feed meta" do @@ -323,14 +323,14 @@ let(:overrides) { { "lang" => "en-US" } } it "should set the language" do - expect(contents).to match %r!type="text/html" hreflang="en-US" />! + expect(contents).to match 'type="text/html" hreflang="en-US" />' end end context "with post.lang set" do it "should set the language for that entry" do - expect(contents).to match %r!! - expect(contents).to match %r!! + expect(contents).to match '' + expect(contents).to match '' end end @@ -344,18 +344,18 @@ let(:news_feed) { File.read(dest_dir("feed/news.xml")) } it "outputs the primary feed" do - expect(contents).to match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! - expect(contents).to match %r!http://example\.org/news/2014/03/02/march-the-second\.html! - expect(contents).to match %r!http://example\.org/news/2013/12/12/dec-the-second\.html! + expect(contents).to match "http://example.org/updates/2014/03/04/march-the-fourth.html" + expect(contents).to match "http://example.org/news/2014/03/02/march-the-second.html" + expect(contents).to match "http://example.org/news/2013/12/12/dec-the-second.html" expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html" - expect(contents).to_not match %r!http://example\.org/2016/02/09/a-draft\.html! + expect(contents).to_not match "http://example.org/2016/02/09/a-draft.html" end it "outputs the category feed" do - expect(news_feed).to match "My awesome site | News" - expect(news_feed).to match %r!http://example\.org/news/2014/03/02/march-the-second\.html! - expect(news_feed).to match %r!http://example\.org/news/2013/12/12/dec-the-second\.html! - expect(news_feed).to_not match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! + expect(news_feed).to match 'My awesome site | News' + expect(news_feed).to match "http://example.org/news/2014/03/02/march-the-second.html" + expect(news_feed).to match "http://example.org/news/2013/12/12/dec-the-second.html" + expect(news_feed).to_not match "http://example.org/updates/2014/03/04/march-the-fourth.html" expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" end end @@ -375,18 +375,18 @@ let(:news_feed) { File.read(dest_dir("feed/news.xml")) } it "outputs the primary feed" do - expect(contents).to match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! - expect(contents).to match %r!http://example\.org/news/2014/03/02/march-the-second\.html! - expect(contents).to match %r!http://example\.org/news/2013/12/12/dec-the-second\.html! + expect(contents).to match "http://example.org/updates/2014/03/04/march-the-fourth.html" + expect(contents).to match "http://example.org/news/2014/03/02/march-the-second.html" + expect(contents).to match "http://example.org/news/2013/12/12/dec-the-second.html" expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html" - expect(contents).to_not match %r!http://example\.org/2016/02/09/a-draft\.html! + expect(contents).to_not match "http://example.org/2016/02/09/a-draft.html" end it "outputs the category feed" do - expect(news_feed).to match "My awesome site | News" - expect(news_feed).to match %r!http://example\.org/news/2014/03/02/march-the-second\.html! - expect(news_feed).to match %r!http://example\.org/news/2013/12/12/dec-the-second\.html! - expect(news_feed).to_not match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! + expect(news_feed).to match 'My awesome site | News' + expect(news_feed).to match "http://example.org/news/2014/03/02/march-the-second.html" + expect(news_feed).to match "http://example.org/news/2013/12/12/dec-the-second.html" + expect(news_feed).to_not match "http://example.org/updates/2014/03/04/march-the-fourth.html" expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" end end @@ -408,10 +408,10 @@ end it "outputs the collection feed" do - expect(collection_feed).to match "My awesome site | Collection" + expect(collection_feed).to match 'My awesome site | Collection' expect(collection_feed).to match "http://example.org/collection/2018-01-01-collection-doc.html" expect(collection_feed).to match "http://example.org/collection/2018-01-02-collection-category-doc.html" - expect(collection_feed).to_not match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! + expect(collection_feed).to_not match "http://example.org/updates/2014/03/04/march-the-fourth.html" expect(collection_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" end end @@ -436,10 +436,10 @@ let(:news_feed) { File.read(dest_dir("feed/collection/news.xml")) } it "outputs the collection category feed" do - expect(news_feed).to match "My awesome site | Collection | News" + expect(news_feed).to match 'My awesome site | Collection | News' expect(news_feed).to match "http://example.org/collection/2018-01-02-collection-category-doc.html" expect(news_feed).to_not match "http://example.org/collection/2018-01-01-collection-doc.html" - expect(news_feed).to_not match %r!http://example\.org/updates/2014/03/04/march-the-fourth\.html! + expect(news_feed).to_not match "http://example.org/updates/2014/03/04/march-the-fourth.html" expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" end end