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 Mar 11, 2022
1 parent bc706d8 commit 8bcc8d0
Show file tree
Hide file tree
Showing 27 changed files with 1,117 additions and 2,249 deletions.
6 changes: 6 additions & 0 deletions context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import (
"os"
"testing"

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

"github.com/stretchr/testify/assert"
)
Expand All @@ -31,6 +33,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 @@ -40,6 +45,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 8bcc8d0

Please sign in to comment.