Skip to content

Enable RSpec/DescribeClass #17015

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

Merged
merged 1 commit into from
Apr 3, 2024
Merged

Enable RSpec/DescribeClass #17015

merged 1 commit into from
Apr 3, 2024

Conversation

dduugg
Copy link
Member

@dduugg dduugg commented Apr 3, 2024

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Follow-up to https://github.com/Homebrew/brew/pull/16815/files#r1518269399

Disabling this cop made sense, when we would have had ~100 command spec files using Homebrew, but now they're each individually namespaced.

There are still a few stray files that don't make sense to spec under a class. For the most part, I used the escape hatch of labeling them type: system. That's arguably too esoteric though, and perhaps I should just rubocop:disable them instead (but i consider the latter to be a bit of an eyesore). Feedback welcome.

@@ -1,25 +0,0 @@
# frozen_string_literal: true

RSpec.describe "conflicts_with", :cask do
Copy link
Member Author

Choose a reason for hiding this comment

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

It seemed weird to have this in its own file – I moved this to dsl_spec, where there are similar tests.

@@ -2,7 +2,9 @@

# TODO: this test should be named after the corresponding class, once
# that class is abstracted from installer.rb
# rubocop:disable RSpec/DescribeClass
Copy link
Member Author

Choose a reason for hiding this comment

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

This would resolve with the TODO above it.

@@ -229,15 +229,3 @@ def formula(name = "formula_name", path: Formulary.core_path(name), spec: :stabl
end.to raise_error(BuildError)
end
end

__END__
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated cleanup

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks good, thanks again @dduugg!

@MikeMcQuaid MikeMcQuaid enabled auto-merge April 3, 2024 18:24
@MikeMcQuaid MikeMcQuaid merged commit fcc190b into master Apr 3, 2024
@MikeMcQuaid MikeMcQuaid deleted the describe-class branch April 3, 2024 18:27
@github-actions github-actions bot added the outdated PR was locked due to age label May 4, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants