tpl: Fix the remaining template funcs namespace issues

See #3042
This commit is contained in:
Bjørn Erik Pedersen
2017-05-01 09:06:42 +02:00
parent 4714085a10
commit 0e2260421e
41 changed files with 396 additions and 485 deletions

View File

@@ -43,9 +43,6 @@ type Namespace struct {
deps *deps.Deps
}
// Namespace returns a pointer to the current namespace instance.
func (ns *Namespace) Namespace() *Namespace { return ns }
// Config returns the image.Config for the specified path relative to the
// working directory.
func (ns *Namespace) Config(path interface{}) (image.Config, error) {

View File

@@ -80,17 +80,6 @@ var configTests = []struct {
{path: "", expect: false},
}
func TestNamespace(t *testing.T) {
t.Parallel()
v := viper.New()
v.Set("workingDir", "/a/b")
ns := New(&deps.Deps{Fs: hugofs.NewMem(v)})
assert.Equal(t, ns, ns.Namespace(), "object pointers should match")
}
func TestNSConfig(t *testing.T) {
t.Parallel()