diff options
author | Igor Drozdov <idrozdov@gitlab.com> | 2019-05-20 10:09:56 +0300 |
---|---|---|
committer | Igor Drozdov <idrozdov@gitlab.com> | 2019-05-20 13:03:11 +0300 |
commit | 60280bbfc1a1cfb591bf01f3a06e828dcf97728a (patch) | |
tree | e374fb22294861082fa6fc82098b2db3d0ebb856 /go/internal/command/fallback | |
parent | 58d8c7691ac52c00dfebe2154e793c8fccc46aa0 (diff) | |
download | gitlab-shell-60280bbfc1a1cfb591bf01f3a06e828dcf97728a.tar.gz |
Pass readWriter to Command constructor
Diffstat (limited to 'go/internal/command/fallback')
-rw-r--r-- | go/internal/command/fallback/fallback.go | 4 | ||||
-rw-r--r-- | go/internal/command/fallback/fallback_test.go | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/go/internal/command/fallback/fallback.go b/go/internal/command/fallback/fallback.go index 71e2a98..f525a57 100644 --- a/go/internal/command/fallback/fallback.go +++ b/go/internal/command/fallback/fallback.go @@ -4,8 +4,6 @@ import ( "os" "path/filepath" "syscall" - - "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/readwriter" ) type Command struct { @@ -22,7 +20,7 @@ const ( RubyProgram = "gitlab-shell-ruby" ) -func (c *Command) Execute(*readwriter.ReadWriter) error { +func (c *Command) Execute() error { rubyCmd := filepath.Join(c.RootDir, "bin", RubyProgram) // Ensure rubyArgs[0] is the full path to gitlab-shell-ruby diff --git a/go/internal/command/fallback/fallback_test.go b/go/internal/command/fallback/fallback_test.go index 2d67b14..afd752b 100644 --- a/go/internal/command/fallback/fallback_test.go +++ b/go/internal/command/fallback/fallback_test.go @@ -49,7 +49,7 @@ func TestExecuteExecsCommandSuccesfully(t *testing.T) { fake.Setup() defer fake.Cleanup() - require.NoError(t, cmd.Execute(nil)) + require.NoError(t, cmd.Execute()) require.True(t, fake.Called) require.Equal(t, fake.Filename, "/tmp/bin/gitlab-shell-ruby") require.Equal(t, fake.Args, []string{"/tmp/bin/gitlab-shell-ruby", "foo", "bar"}) @@ -64,12 +64,12 @@ func TestExecuteExecsCommandOnError(t *testing.T) { fake.Setup() defer fake.Cleanup() - require.Error(t, cmd.Execute(nil)) + require.Error(t, cmd.Execute()) require.True(t, fake.Called) } func TestExecuteGivenNonexistentCommand(t *testing.T) { cmd := &Command{RootDir: "/tmp/does/not/exist", Args: fakeArgs} - require.Error(t, cmd.Execute(nil)) + require.Error(t, cmd.Execute()) } |