aboutsummaryrefslogtreecommitdiff
path: root/watcher_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-02-21 21:41:27 +0700
committerShulhan <ms@kilabit.info>2021-02-21 21:41:27 +0700
commit34f8dc935260582487bf451b6e9301e83414bb98 (patch)
treeb89aad6491c1dba8840813400615d8234b95fbf3 /watcher_test.go
parente554256948d0f7b4b71dfa78014e2172f11fc1c6 (diff)
downloadciigo-34f8dc935260582487bf451b6e9301e83414bb98.tar.xz
all: rewrite to use the watcher
Now that we have the watcher which task are to watch the asciidoc files and template files, we can use it in server to minimize duplicate code. This changes refactoring the htmlGenerator to initialize the HTML template from internal or memfs, so the caller did not need to check by itself.
Diffstat (limited to 'watcher_test.go')
-rw-r--r--watcher_test.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/watcher_test.go b/watcher_test.go
index 043266a..e85e053 100644
--- a/watcher_test.go
+++ b/watcher_test.go
@@ -32,7 +32,12 @@ func TestWatcher(t *testing.T) {
os.RemoveAll(testDir)
})
- testWatcher, err = newWatcher(testDir, "testdata/html.tmpl")
+ htmlg, err := newHTMLGenerator(nil, "testdata/html.tmpl", true)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ testWatcher, err = newWatcher(htmlg, testDir)
if err != nil {
t.Fatal(err)
}