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

Expose files to support testing Cops using RSpec #3179

Merged
merged 1 commit into from Jun 8, 2016

Conversation

Projects
None yet
4 participants
@tjwp
Contributor

tjwp commented May 29, 2016

I made a guess at the files that would be useful to expose.

I've verified that this removes the need for a clone of rubocop to run tests for rubocop-rspec.

The exposed files can be loaded from spec_helper using:

require 'rubocop/rspec/support'

Supporting files were copied unmodified, except for module + class level comments added to cop_helper.rb to fix RuboCop offenses.

Fixes #3176.

  • Wrote good commit messages.
  • Used the same coding conventions as the rest of the project.
  • Feature branch is up-to-date with master (if not - rebase it)
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • All tests are passing.
  • The new code doesn't generate RuboCop offenses.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
@mikegee

This comment has been minimized.

Show comment
Hide comment
@mikegee

mikegee May 29, 2016

Contributor

I have a Rubocop extension and putting Rubocop in a git submodule to make the specs work was definely the suckiest part. Thanks @tjwp

Contributor

mikegee commented May 29, 2016

I have a Rubocop extension and putting Rubocop in a git submodule to make the specs work was definely the suckiest part. Thanks @tjwp

@rspeicher

This comment has been minimized.

Show comment
Hide comment
@rspeicher

rspeicher May 30, 2016

@tjwp Awesome, thanks for tackling this!

rspeicher commented May 30, 2016

@tjwp Awesome, thanks for tackling this!

tjwp pushed a commit to salsify/rubocop-rspec that referenced this pull request May 31, 2016

Tim Perkins
Remove the requirement for a rubocop submodule
This depends on the change rubocop-hq/rubocop#3179
to expose files in RuboCop to support testing with RSpec.

When that is merged and released this branch will be updated.
@bbatsov

This comment has been minimized.

Show comment
Hide comment
@bbatsov

bbatsov Jun 1, 2016

Collaborator

I'm fine with this change. Just rebase this branch on top of the current master.

Collaborator

bbatsov commented Jun 1, 2016

I'm fine with this change. Just rebase this branch on top of the current master.

@tjwp

This comment has been minimized.

Show comment
Hide comment
@tjwp

tjwp Jun 1, 2016

Contributor

Rebased. Thanks!

Contributor

tjwp commented Jun 1, 2016

Rebased. Thanks!

@bbatsov

This comment has been minimized.

Show comment
Hide comment
@bbatsov

bbatsov Jun 8, 2016

Collaborator

You'll have to do this again. :-(

Collaborator

bbatsov commented Jun 8, 2016

You'll have to do this again. :-(

Tim Perkins
Expose files to support testing Cops using RSpec
The exposed files can be loaded from spec_helper using:

    require 'rubocop/rspec/support'
@tjwp

This comment has been minimized.

Show comment
Hide comment
@tjwp

tjwp Jun 8, 2016

Contributor

@bbatsov No problem. Rebased again.

Contributor

tjwp commented Jun 8, 2016

@bbatsov No problem. Rebased again.

@bbatsov bbatsov merged commit d3118ed into rubocop-hq:master Jun 8, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

tjwp pushed a commit to salsify/rubocop-rspec that referenced this pull request Jun 8, 2016

Tim Perkins
Remove the requirement for a rubocop submodule
This depends on the change rubocop-hq/rubocop#3179
to expose files in RuboCop to support testing with RSpec.

When that is merged and released this branch will be updated.

tjwp pushed a commit to salsify/rubocop-rspec that referenced this pull request Jun 8, 2016

Tim Perkins
Remove the requirement for a rubocop submodule
This depends on the change rubocop-hq/rubocop#3179
to expose files in RuboCop to support testing with RSpec.

That change has been merged to master. When it is available in a rubocop
release this branch will be updated.

bquorning added a commit to bquorning/rubocop-rspec that referenced this pull request Jun 28, 2016

Use spec helpers exposed by RuboCop
In RuboCop v0.41.0, spec helpers are released as part of the gem. This means
that installing all of the RuboCop source as a git submodule, and jumping
through hoops to require the correct files, is no longer needed.

See rubocop-hq/rubocop#3179

Neodelf added a commit to Neodelf/rubocop that referenced this pull request Oct 15, 2016

Expose files to support testing Cops using RSpec (rubocop-hq#3179)
The exposed files can be loaded from spec_helper using:

    require 'rubocop/rspec/support'

pocke added a commit to pocke/rubocop that referenced this pull request Apr 1, 2018

Remove `spec/support_cop_helper.rb` from the gemspec
This file has been moved to `lib/rubocop/rspec/cop_helper.rb`.
rubocop-hq#3179
However, it still exists in the gemspec `files` configuration.
So this change just removes it from the gemspec.

bbatsov added a commit that referenced this pull request Apr 1, 2018

Remove `spec/support_cop_helper.rb` from the gemspec
This file has been moved to `lib/rubocop/rspec/cop_helper.rb`.
#3179
However, it still exists in the gemspec `files` configuration.
So this change just removes it from the gemspec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment