Skip to content

Commit

Permalink
helmfile#190-FetchInteger: TestCase
Browse files Browse the repository at this point in the history
Signed-off-by: Gianluca Artioli <[email protected]>
  • Loading branch information
Gianluca Artioli committed Aug 12, 2024
1 parent bf5fe1e commit f22b744
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions vals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,37 @@ kind: Secret

require.Equal(t, expected, buf.String())
}

func TestEvalIntegerBool(t *testing.T) {
var yamlDocs = `
---
Integer: 1
ResultInteger: ref+file://secrets.yaml#/Integer
Bool: true
ResultBool: ref+file://secrets.yaml#/Bool
`
var expected = `Bool: true
Integer: 1
ResultBool: "true"
ResultInteger: "1"
`

tmpFile, err := os.Create("secrets.yaml")
defer os.Remove(tmpFile.Name())
require.NoError(t, err)

_, err = tmpFile.WriteString(yamlDocs)
require.NoError(t, err)

input, err := Inputs(tmpFile.Name())
require.NoError(t, err)

nodes, err := EvalNodes(input, Options{})
require.NoError(t, err)
buf := new(strings.Builder)

err = Output(buf, "", nodes)
require.NoError(t, err)

require.Equal(t, expected, buf.String())
}

0 comments on commit f22b744

Please sign in to comment.