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

Removes using_test_classes #203

Merged
merged 2 commits into from
Oct 31, 2021
Merged

Removes using_test_classes #203

merged 2 commits into from
Oct 31, 2021

Conversation

ehannes
Copy link
Member

@ehannes ehannes commented Oct 29, 2021

Fixes #200

Instead of using the advanced using_test_classes, we can just stub the constants. You could use let statements for some of the cases as well, but when you want to do slightly more, like wrapping the class in a module, stubbing constants is much easier. I think it's best to keep things consistent here, so I decided to make all test classes into stubbed constants. It's very easy to read as well.

https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LeakyConstantDeclaration

Instead of using the advanced using_test_classes, we can just stub
the constants. You could use let statements for some of these as well,
but when you want to do slightly more, like wrapping the class in a
module, stubbing constants is much easier. I think it's best to keep
things consistent here, so I decided to make all test classes into
stubbed constants. It's very easy to read as well.

https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LeakyConstantDeclaration
@ehannes ehannes requested a review from d-Pixie October 29, 2021 21:01
@codeclimate
Copy link

codeclimate bot commented Oct 29, 2021

Code Climate has analyzed commit 831148e and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 98.4% (0.0% change).

View more on Code Climate.

@d-Pixie d-Pixie merged commit 11068dd into development Oct 31, 2021
@ehannes ehannes deleted the remove-dummy-classes branch April 27, 2022 12:37
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.

Replace leaking test dummy classes
2 participants