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

Expose files to support testing Cops using RSpec #3179

Merged
merged 1 commit into from
Jun 8, 2016
Merged

Expose files to support testing Cops using RSpec #3179

merged 1 commit into from
Jun 8, 2016

Conversation

tjwp
Copy link
Contributor

@tjwp 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
Copy link
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
Copy link
Contributor

@tjwp Awesome, thanks for tackling this!

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 1, 2016

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

@tjwp
Copy link
Contributor Author

tjwp commented Jun 1, 2016

Rebased. Thanks!

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 8, 2016

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

The exposed files can be loaded from spec_helper using:

    require 'rubocop/rspec/support'
@tjwp
Copy link
Contributor Author

tjwp commented Jun 8, 2016

@bbatsov No problem. Rebased again.

@bbatsov bbatsov merged commit d3118ed into rubocop:master Jun 8, 2016
bquorning added a commit to bquorning/rubocop-rspec that referenced this pull request Jun 28, 2016
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/rubocop#3179
Neodelf pushed a commit to Neodelf/rubocop that referenced this pull request Oct 15, 2016
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
This file has been moved to `lib/rubocop/rspec/cop_helper.rb`.
rubocop#3179
However, it still exists in the gemspec `files` configuration.
So this change just removes it from the gemspec.
bbatsov pushed a commit that referenced this pull request Apr 1, 2018
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.
highb pushed a commit to highb/rubocop-i18n that referenced this pull request Aug 28, 2019
Prior to this commit we copied `cop_helper.rb` over from the main Rubocop
project so that we could re-use it in our specs.
This commit adds the new `rubocop/rspec/support` added in
rubocop/rubocop#3179 and then removes the
copied `cop_helper.rb`, as it is no longer needed.
highb pushed a commit to highb/rubocop-i18n that referenced this pull request Aug 28, 2019
Prior to this commit we copied `cop_helper.rb` over from the main Rubocop
project so that we could re-use it in our specs.
This commit adds the new `rubocop/rspec/support` added in
rubocop/rubocop#3179 and then removes the
copied `cop_helper.rb`, as it is no longer needed.
highb pushed a commit to highb/rubocop-i18n that referenced this pull request Aug 28, 2019
Prior to this commit we copied `cop_helper.rb` over from the main Rubocop
project so that we could re-use it in our specs.
This commit adds the new `rubocop/rspec/support` added in
rubocop/rubocop#3179 and then removes the
copied `cop_helper.rb`, as it is no longer needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move CopHelper to a file in lib so it can be included outside RuboCop?
4 participants