summaryrefslogtreecommitdiffstats
path: root/pkg/commands/oscommands/os_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/commands/oscommands/os_test.go')
-rw-r--r--pkg/commands/oscommands/os_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkg/commands/oscommands/os_test.go b/pkg/commands/oscommands/os_test.go
index 78dfa48ec..e4859484c 100644
--- a/pkg/commands/oscommands/os_test.go
+++ b/pkg/commands/oscommands/os_test.go
@@ -227,6 +227,28 @@ func TestOSCommandEditFile(t *testing.T) {
assert.NoError(t, err)
},
},
+ {
+ "file/with space",
+ func(name string, args ...string) *exec.Cmd {
+ if name == "which" {
+ return exec.Command("echo")
+ }
+
+ assert.EqualValues(t, "vi", name)
+ assert.EqualValues(t, "file/with space", args[0])
+
+ return nil
+ },
+ func(env string) string {
+ return ""
+ },
+ func(cf string) (string, error) {
+ return "", nil
+ },
+ func(cmd *exec.Cmd, err error) {
+ assert.NoError(t, err)
+ },
+ },
}
for _, s := range scenarios {