From 96ab610f904c48fa4e85bb42e212f49eb3a4ff1c Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Sat, 10 Feb 2018 10:13:58 -0500 Subject: Adding file namespace Signed-off-by: Dave Henderson --- test/integration/file_test.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/integration/file_test.go (limited to 'test') 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") +} -- cgit v1.2.3