fstest

package
v0.0.0-...-3098c48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package fstest provides testing utilities for testing the fs package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeFS

type FakeFS struct {
	afero.Afero
	Frozen []string
	Thawed []string
}

FakeFS is an In-Memory-Filesystem with predefined directories.

func NewFake

func NewFake(dirs []string) *FakeFS

NewFake creates a new instance of FakeFS.

func (*FakeFS) Freeze

func (fs *FakeFS) Freeze(path string) error

Freeze adds path to field Frozen.

func (*FakeFS) Thaw

func (fs *FakeFS) Thaw(path string) error

Thaw adds path to field Thawed.

type MockFS

type MockFS struct {
	mock.Mock
}

MockFS is a filesystem mock.

func (*MockFS) DirExists

func (fs *MockFS) DirExists(path string) (bool, error)

DirExists is mocked function.

func (*MockFS) Freeze

func (fs *MockFS) Freeze(path string) error

Freeze is mocked function.

func (*MockFS) ReadDir

func (fs *MockFS) ReadDir(path string) ([]os.FileInfo, error)

ReadDir is mocked function.

func (*MockFS) Thaw

func (fs *MockFS) Thaw(path string) error

Thaw is mocked function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL