Skip to content

Commit bf89af2

Browse files
Igor Drozdove_forbes
authored andcommitted
Merge branch 'ef-migrating-more-ruby-tests-to-go' into 'main'
Removes more Ruby Spec tests in favour of Go tests See merge request https://gitlab.com/gitlab-org/gitlab-shell/-/merge_requests/1367 Merged-by: Igor Drozdov <idrozdov@gitlab.com> Approved-by: Igor Drozdov <idrozdov@gitlab.com> Co-authored-by: e_forbes <eforbes@gitlab.com>
2 parents 78e3f4e + 434404d commit bf89af2

3 files changed

Lines changed: 9 additions & 224 deletions

File tree

cmd/gitlab-shell-authorized-keys-check/command/command_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ func TestParseSuccess(t *testing.T) {
6060
arguments: []string{"git", "git", "key"},
6161
expectedArgs: &commandargs.AuthorizedKeys{Arguments: []string{"git", "git", "key"}, ExpectedUser: "git", ActualUser: "git", Key: "key"},
6262
},
63+
{
64+
// this seems counter-intuitive, but this ensures we're preserving the
65+
// current logic when handling this situation/
66+
desc: "No error when expected user does not match actual user",
67+
executable: &executable.Executable{Name: executable.AuthorizedKeysCheck},
68+
arguments: []string{"expected", "actual", "key"},
69+
expectedArgs: &commandargs.AuthorizedKeys{Arguments: []string{"expected", "actual", "key"}, ExpectedUser: "expected", ActualUser: "actual", Key: "key"},
70+
expectError: false,
71+
},
6372
}
6473

6574
for _, tc := range testCases {
@@ -109,11 +118,9 @@ func TestParseFailure(t *testing.T) {
109118
expectedError: "# No key provided",
110119
},
111120
}
112-
113121
for _, tc := range testCases {
114122
t.Run(tc.desc, func(t *testing.T) {
115123
_, err := command.Parse(tc.arguments)
116-
117124
require.EqualError(t, err, tc.expectedError)
118125
})
119126
}

spec/gitlab_shell_authorized_keys_check_spec.rb

Lines changed: 0 additions & 112 deletions
This file was deleted.

spec/gitlab_shell_two_factor_recovery_spec.rb

Lines changed: 0 additions & 110 deletions
This file was deleted.

0 commit comments

Comments
 (0)