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

Fix RuboCop Performance offenses in test files #7839

Merged
merged 2 commits into from Oct 6, 2019

Conversation

@udayan28
Copy link
Contributor

commented Oct 3, 2019

Summary

Remove Rubocop offence of Performance/Detect.

Context

test/test_document.rb:178:52: C: Performance/Detect: Use find instead of select.first.
      @document = @site.collections["slides"].docs.select { |d| d.is_a?(Document) }.first

test/test_filters.rb:1039:28: C: Performance/Count: Use count instead of select...count.
        assert_equal posts.select { |p| p.date > @sample_time }.count, results.length

Closes #7840

@DirtyF
DirtyF approved these changes Oct 3, 2019
@ashmaroli

This comment has been minimized.

Copy link
Member

commented Oct 3, 2019

Hello @udayan28 👋
Thank you for submitting the fixes.
Can you please include the changes in #7840 in this PR instead? That way, we can fix the failing CI builds in a single go..

@ashmaroli ashmaroli changed the title Replace select.first with find Fix RuboCop Performance offenses in test files Oct 6, 2019
@ashmaroli

This comment has been minimized.

Copy link
Member

commented Oct 6, 2019

Thank you @udayan28

@ashmaroli ashmaroli merged commit 3eab32f into jekyll:master Oct 6, 2019
7 checks passed
7 checks passed
SUITE: test / OS: ubuntu-latest
Details
SUITE: test / OS: windows-latest
Details
SUITE: default-site / OS: ubuntu-latest
Details
SUITE: default-site / OS: windows-latest
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
netlify/jekyllrb/deploy-preview Deploy preview ready!
Details
donquxiote added a commit to donquxiote/jekyll that referenced this pull request Oct 6, 2019
Fix RuboCop Performance offenses in test files (jekyll#7839)
@udayan28

This comment has been minimized.

Copy link
Contributor Author

commented Oct 7, 2019

@ashmaroli
Sorry for rate reply.
Thank you for fixing my pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.