Skip to content

Move away from RSpec's described_class#22307

Draft
issyl0 wants to merge 3 commits into
mainfrom
move-away-from-rspec-described-class
Draft

Move away from RSpec's described_class#22307
issyl0 wants to merge 3 commits into
mainfrom
move-away-from-rspec-described-class

Conversation

@issyl0
Copy link
Copy Markdown
Member

@issyl0 issyl0 commented May 16, 2026


  • 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? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

Comment thread Library/Homebrew/test/bundle/flatpak_spec.rb Dismissed
Comment thread Library/Homebrew/test/bundle/flatpak_spec.rb Dismissed
Comment thread Library/Homebrew/test/bundle/flatpak_spec.rb Dismissed
Copy link
Copy Markdown
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.

Sorry to be that guy: now I'm actually looking at the diff, I kinda hate it 😭.

Could we do something like a type alias or e.g. test_alias = Homebrew::API::Cask::CaskStructGenerator to have RSpec handle this better with Sorbet while avoiding the excessive repetition?

@issyl0
Copy link
Copy Markdown
Member Author

issyl0 commented May 17, 2026

Sorry to be that guy: now I'm actually looking at the diff, I kinda hate it 😭.

Hah, it is quite a lot of diff.

Could we do something like a type alias or e.g. test_alias = Homebrew::API::Cask::CaskStructGenerator to have RSpec handle this better with Sorbet while avoiding the excessive repetition?

To avoid the excessive repetition let(:klass) { Homebrew::Api::Cask::CaskStructGenerator } seems to work, so we can use klass everywhere, and if the name ever changes then there's only a few places to update?

@MikeMcQuaid
Copy link
Copy Markdown
Member

To avoid the excessive repetition let(:klass) { Homebrew::Api::Cask::CaskStructGenerator } seems to work, so we can use klass everywhere, and if the name ever changes then there's only a few places to update?

Works for me!

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.

3 participants