-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Add test coverage for Mastodon::AccountsCLI
#24541
Add test coverage for Mastodon::AccountsCLI
#24541
Conversation
While trying to write tests for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ClearlyClaire what do you think? I'd appreciate any suggestions on how to improve the tests.
Just a small inline nitpick but otherwise it looks great overall!
Yes, that's a bug, good catch. Another thing I noticed is that the test failures in CI seem to omit the actual error. I wonder if it's because of not capturing or silencing the output of the Thor commands. |
6712cf9
to
82384e8
Compare
Turns out that there were two tests reaching the @ClearlyClaire, is #24557 expected to be merged anytime soon? So that I can include tests for the Should this PR only address specs for |
I cannot say, someone else on the team needs to review it.
I think both are fine but I'd prefer individual PRs. |
71a3356
to
dd83061
Compare
Mastodon::AccountsCLI
5261761
to
a39e801
Compare
Hi @ClearlyClaire, could you help me with this? Some methods (e.g. I'm having problems trying to work around that. I did some research and I found the following options:
The first one sounds a bit odd and I'm not sure if it would actually behave properly. As for the second one, I'm not sure about what side effects it could cause to add a new gem to the project. What do you think? Do you have any suggestions on how I could test these methods? |
Oh… that is annoying… this is not ideal, but I think one acceptable short-term solution way would be to stub
I'm under the “second option” would still rely on the first one? |
I've tried that by stubbing
I did some more research to understand better how this gem works and I came across this. That solution seems to fit this case. However, I don't know if replacing @ClearlyClaire what do you think? |
a39e801
to
11df2a6
Compare
I would stick with |
99f3e73
to
c94ec0b
Compare
7b9b13a
to
aaed923
Compare
aaed923
to
b8b662c
Compare
Mastodon::AccountsCLI
Mastodon::AccountsCLI
This PR adds test coverage for
Mastodon::AccountsCLI
Sorry for the huge PR, I should've split it in two at least. But I tried making commits as organized as possible to help with the review.
Methods covered:
Mastodon::AccountsCLI#rotate
Mastodon::AccountsCLI#create
Mastodon::AccountsCLI#modify
Mastodon::AccountsCLI#delete
Mastodon::AccountsCLI#merge
Mastodon::AccountsCLI#fix_duplicates
Mastodon::AccountsCLI#backup
Mastodon::AccountsCLI#cull
Mastodon::AccountsCLI#refresh
Mastodon::AccountsCLI#follow
Mastodon::AccountsCLI#unfollow
Mastodon::AccountsCLI#reset_relantionships
Mastodon::AccountsCLI#approve
Mastodon::AccountsCLI#prune
Mastodon::AccountsCLI#migrate
Coverage: 98.94%