Skip to content

Commit

Permalink
Use go-fsimpl to read from datasources
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Henderson <[email protected]>
  • Loading branch information
hairyhenderson committed Jun 26, 2022
1 parent e5b3cc6 commit df51841
Show file tree
Hide file tree
Showing 27 changed files with 1,012 additions and 2,238 deletions.
6 changes: 6 additions & 0 deletions context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import (
"os"
"testing"

"github.com/hairyhenderson/go-fsimpl"
"github.com/hairyhenderson/gomplate/v3/data"
"github.com/hairyhenderson/gomplate/v3/internal/datafs"

"github.com/stretchr/testify/assert"
)
Expand All @@ -30,6 +32,9 @@ func TestCreateContext(t *testing.T) {
assert.NoError(t, err)
assert.Empty(t, c)

fsmux := fsimpl.NewMux()
fsmux.Add(datafs.EnvFS)

fooURL := "env:///foo?type=application/yaml"
barURL := "env:///bar?type=application/yaml"
uf, _ := url.Parse(fooURL)
Expand All @@ -39,6 +44,7 @@ func TestCreateContext(t *testing.T) {
"foo": {URL: uf},
".": {URL: ub},
},
FSMux: fsmux,
}
os.Setenv("foo", "foo: bar")
defer os.Unsetenv("foo")
Expand Down
Loading

0 comments on commit df51841

Please sign in to comment.