diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2018-02-10 10:13:58 -0500 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2018-03-03 10:58:05 -0500 |
| commit | 96ab610f904c48fa4e85bb42e212f49eb3a4ff1c (patch) | |
| tree | 81caae2b83298694798eea978a2e28380e29ef62 /test | |
| parent | 5f47dac2c1273e189f4b70b74a6dfea68cf788ff (diff) | |
Adding file namespace
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'test')
| -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") +} |
