add tests for main method

This commit is contained in:
Dominic Breuker
2018-03-16 09:33:22 +01:00
parent 9b43b8fe9d
commit f412c74160
4 changed files with 125 additions and 14 deletions

View File

@@ -7,6 +7,7 @@ import (
"os/signal"
"strings"
"syscall"
"time"
"github.com/dominicbreuker/pspy/internal/config"
"github.com/dominicbreuker/pspy/internal/fswatcher"
@@ -69,10 +70,12 @@ func root(cmd *cobra.Command, args []string) {
logger := logging.NewLogger()
cfg := &config.Config{
RDirs: rDirs,
Dirs: dirs,
LogPS: logPS,
LogFS: logFS,
RDirs: rDirs,
Dirs: dirs,
LogPS: logPS,
LogFS: logFS,
DrainFor: 1 * time.Second,
TriggerEvery: 100 * time.Millisecond,
}
fsw := fswatcher.NewFSWatcher()
defer fsw.Close()