Skip to content

Commit

Permalink
Add hcl testing
Browse files Browse the repository at this point in the history
  • Loading branch information
paked committed Dec 13, 2015
1 parent edda264 commit 3f8c696
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions hcl_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package configure

import (
"io"
"strings"
"testing"
)

func TestHCL(t *testing.T) {
src := `s = "hello"`

hcl := NewHCL(func() (io.Reader, error) {
return strings.NewReader(src), nil
})

hcl.Setup()

if v, err := hcl.String("s"); v != "hello" {
t.Errorf("hello %v 'hello' %v", v, err)
}

if _, err := hcl.String("this-message-does-not-exist"); err == nil {
t.Error("hello2")
}
}

0 comments on commit 3f8c696

Please sign in to comment.