예제 #1
0
func newWatcherFixture() *watcherFixture {
	self := &watcherFixture{}
	self.files = system.NewFakeFileSystem()
	self.shell = system.NewFakeShell()
	self.watcher = NewWatcher(self.files, self.shell)
	return self
}
예제 #2
0
func newWatcherFixture() *watcherFixture {
	self := new(watcherFixture)
	self.files = system.NewFakeFileSystem()
	self.shell = system.NewFakeShell()
	self.shell.Setenv("GOPATH", gopath)
	self.watcher = NewWatcher(self.files, self.shell)
	return self
}
예제 #3
0
func newScannerFixture() *scannerFixture {
	self := &scannerFixture{}
	self.fs = system.NewFakeFileSystem()
	self.fs.Create("/root", 0, time.Now())
	self.fs.Create("/root/file.go", 1, time.Now())
	self.fs.Create("/root/sub", 0, time.Now())
	self.fs.Create("/root/sub/file.go", 2, time.Now())
	self.fs.Create("/root/sub/empty", 0, time.Now())
	self.watcher = newWatcherWrapper(NewWatcher(self.fs, system.NewFakeShell()))
	self.watcher.Adjust("/root")
	self.scanner = NewScanner(self.fs, self.watcher)
	return self
}