Skip to content

Commit

Permalink
add run package tests
Browse files Browse the repository at this point in the history
  • Loading branch information
justincarter committed Oct 17, 2016
1 parent dcddcf3 commit dc4370b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions run/run_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package run

import (
"os"
"strings"
"testing"
)

Expand All @@ -18,3 +20,25 @@ func TestOutput(t *testing.T) {
}

}

func TestVBoxManagePath_Path(t *testing.T) {
testVBoxManagePath(t)
}

func TestVBoxManagePath_InstallPath(t *testing.T) {
os.Setenv("VBOX_INSTALL_PATH", "/dummy/install/path")
testVBoxManagePath(t)
}

func TestVBoxManagePath_MSIInstallPath(t *testing.T) {
os.Setenv("VBOX_MSI_INSTALL_PATH", "/dummy/msi/install/path")
testVBoxManagePath(t)
}

func testVBoxManagePath(t *testing.T) {
path := VBoxManagePath()
s := strings.Split(path, string(os.PathSeparator))
if s[len(s)-1] != "VBoxManage" {
t.Fail()
}
}

0 comments on commit dc4370b

Please sign in to comment.