Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: fix offenses in specs #248

Merged
merged 7 commits into from Oct 29, 2018
Merged

style: fix offenses in specs #248

merged 7 commits into from Oct 29, 2018

Conversation

jekyllbot
Copy link
Contributor

@jekyllbot jekyllbot commented Oct 23, 2018

Applied some style rules following this discussion: #228 (comment)

@DirtyF DirtyF changed the title style: Style/RegexpLiteral Use %r around regular expression style: fix offenses in specs Oct 23, 2018
@DirtyF DirtyF requested a review from a team October 23, 2018 14:17
@DirtyF DirtyF added the tests label Oct 23, 2018
Copy link
Member

@ashmaroli ashmaroli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

periods in regexps need to be escaped

spec/jekyll-feed_spec.rb Outdated Show resolved Hide resolved
Copy link
Member

@parkr parkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! One comment.

spec/jekyll-feed_spec.rb Outdated Show resolved Hide resolved
@ashmaroli ashmaroli requested a review from a team October 23, 2018 17:28
@parkr
Copy link
Member

parkr commented Oct 23, 2018

@ashmaroli Why did you convert to strings?

@ashmaroli
Copy link
Member

ashmaroli commented Oct 23, 2018

Why did you convert to strings?

Regexp and String both respond to a #match method in RSpec tests
https://relishapp.com/rspec/rspec-expectations/v/3-8/docs/built-in-matchers/match-matcher

Converting simple regexps (those that do not contain regex meta-characters) to strings improves readability..

Moreover, there are existing instances of "matching with strings" in master:

expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html"

@DirtyF
Copy link
Member

DirtyF commented Oct 29, 2018

@jekyllbot: merge +dev

@jekyllbot jekyllbot merged commit b00b0bf into master Oct 29, 2018
@jekyllbot jekyllbot deleted the pull/rubocop-spec branch October 29, 2018 09:47
jekyllbot added a commit that referenced this pull request Oct 29, 2018
@jekyll jekyll locked and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants