diff options
Diffstat (limited to 'test/integration/file_test.go')
| -rw-r--r-- | test/integration/file_test.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/integration/file_test.go b/test/integration/file_test.go new file mode 100644 index 00000000..4d3fed22 --- /dev/null +++ b/test/integration/file_test.go @@ -0,0 +1,30 @@ +//+build !xxintegration +//+build !windows + +package integration + +import ( + . "gopkg.in/check.v1" + + "github.com/gotestyourself/gotestyourself/fs" +) + +type FileSuite struct { + tmpDir *fs.Dir +} + +var _ = Suite(&FileSuite{}) + +func (s *FileSuite) SetUpSuite(c *C) { + s.tmpDir = fs.NewDir(c, "gomplate-inttests", + fs.WithFile("one", "hi\n"), + fs.WithFile("two", "hello\n")) +} + +func (s *FileSuite) TearDownSuite(c *C) { + s.tmpDir.Remove() +} + +func (s *FileSuite) TestReadsFile(c *C) { + inOutTest(c, `{{ file.Read "`+s.tmpDir.Join("one")+`"}}`, "hi") +} |
