feat: complete tests
This commit is contained in:
@@ -13,13 +13,23 @@ type watcher struct {
|
||||
deploy pkgwatcher.DeployFunc
|
||||
}
|
||||
|
||||
type notifier struct{}
|
||||
|
||||
func (n *notifier) NewWatcher() (*fsnotify.Watcher, error) {
|
||||
return fsnotify.NewWatcher()
|
||||
}
|
||||
|
||||
func NewNotifier() *notifier {
|
||||
return ¬ifier{}
|
||||
}
|
||||
|
||||
var (
|
||||
errEventsClosedChan = errors.New("events is closed")
|
||||
errErrorsClosedChan = errors.New("errors is closed")
|
||||
)
|
||||
|
||||
func NewWatcher(deploy pkgwatcher.DeployFunc) *watcher {
|
||||
wt, err := fsnotify.NewWatcher()
|
||||
func NewWatcher(notifier pkgwatcher.NotifyIface, deploy pkgwatcher.DeployFunc) *watcher {
|
||||
wt, err := notifier.NewWatcher()
|
||||
if err != nil {
|
||||
log.Printf("fsnotify.NewWatcher: %s\n", err)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user