Remove use of deprecated test.InitCmdStubber#2828
Conversation
mislav
left a comment
There was a problem hiding this comment.
This is great. Thank you for the hard work!
Note that you have inadvertently changed some stubs, causing the change in the test logic. I have reverted those stub values to their original.
| cs.Stub(`deadbeef HEAD | ||
| deadb00f refs/remotes/origin/feature | ||
| deadbeef refs/remotes/upstream/feature`) // git show-ref --verify (ShowRefs) |
There was a problem hiding this comment.
The contents of this stub was unnecessarily changed in the rewrite. I will revert it to its original value
| cs.Stub(`branch.feature.remote origin | ||
| branch.feature.merge refs/heads/great-feat`) // git config --get-regexp (ReadBranchConfig) |
There was a problem hiding this comment.
The contents of this stub was replaced with an empty string in the rewrite. I will make a change to bring back the original value
| t.Errorf("expected nil result, got %v", ref) | ||
| } | ||
|
|
||
| assert.Equal(t, []string{"git", "show-ref", "--verify", "--", "HEAD", "refs/remotes/origin/great-feat", "refs/remotes/origin/feature"}, cs.Calls[1].Args) |
There was a problem hiding this comment.
This expectation was replaced with the pattern git show-ref --verify -- HEAD refs/remotes/origin/feature, which is incomplete since it does not include great-feat in the match.
|
@mislav thanks for fixing up those few stubs that I changed. I was struggling with the formatting of the output not matching without adding the newlines. Now I see you can use |
|
@dpromanko No worries. These tests are messy and hard to edit, as evident by me rather leaving |
Follow up to #2801 to cleanup the TODOs around deprecating test.InitCmdStubber.