test from a non-root directory

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
pull/4934/head
Matthew Fisher 7 years ago
parent 819c5c5ed3
commit df85810fdc
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -6,7 +6,7 @@ environment:
install:
- ps: iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/fishworks/gofish/master/scripts/install.ps1'))
- gofish init
- gofish install dep go
- gofish install dep
- go version
- dep ensure -vendor-only
cache:

@ -22,7 +22,7 @@ import (
)
func TestHelmHome(t *testing.T) {
hh := Home("/r")
hh := Home("/r/users/helmtest")
isEq := func(t *testing.T, a, b string) {
if a != b {
t.Error(runtime.GOOS)
@ -30,13 +30,13 @@ func TestHelmHome(t *testing.T) {
}
}
isEq(t, hh.String(), "/r")
isEq(t, hh.Repository(), "/r/repository")
isEq(t, hh.RepositoryFile(), "/r/repository/repositories.yaml")
isEq(t, hh.Cache(), "/r/repository/cache")
isEq(t, hh.CacheIndex("t"), "/r/repository/cache/t-index.yaml")
isEq(t, hh.Starters(), "/r/starters")
isEq(t, hh.Archive(), "/r/cache/archive")
isEq(t, hh.String(), "/r/users/helmtest")
isEq(t, hh.Repository(), "/r/users/helmtest/repository")
isEq(t, hh.RepositoryFile(), "/r/users/helmtest/repository/repositories.yaml")
isEq(t, hh.Cache(), "/r/users/helmtest/repository/cache")
isEq(t, hh.CacheIndex("t"), "/r/users/helmtest/repository/cache/t-index.yaml")
isEq(t, hh.Starters(), "/r/users/helmtest/starters")
isEq(t, hh.Archive(), "/r/users/helmtest/cache/archive")
}
func TestHelmHome_expand(t *testing.T) {

@ -20,18 +20,18 @@ import (
)
func TestHelmHome(t *testing.T) {
hh := Home("r:\\")
hh := Home("r:\\users\\helmtest")
isEq := func(t *testing.T, a, b string) {
if a != b {
t.Errorf("Expected %q, got %q", b, a)
}
}
isEq(t, hh.String(), "r:\\")
isEq(t, hh.Repository(), "r:\\repository")
isEq(t, hh.RepositoryFile(), "r:\\repository\\repositories.yaml")
isEq(t, hh.Cache(), "r:\\repository\\cache")
isEq(t, hh.CacheIndex("t"), "r:\\repository\\cache\\t-index.yaml")
isEq(t, hh.Starters(), "r:\\starters")
isEq(t, hh.Archive(), "r:\\cache\\archive")
isEq(t, hh.String(), "r:\\users\\helmtest")
isEq(t, hh.Repository(), "r:\\users\\helmtestrepository")
isEq(t, hh.RepositoryFile(), "r:\\users\\helmtestrepository\\repositories.yaml")
isEq(t, hh.Cache(), "r:\\users\\helmtestrepository\\cache")
isEq(t, hh.CacheIndex("t"), "r:\\users\\helmtestrepository\\cache\\t-index.yaml")
isEq(t, hh.Starters(), "r:\\users\\helmteststarters")
isEq(t, hh.Archive(), "r:\\users\\helmtestcache\\archive")
}

Loading…
Cancel
Save