Documentation ¶
Overview ¶
Package filesnapshot provides functions that store/restore the snapshot (i.e. the content) of important files during integration test.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot mentions the lookup table from the filename to the corresponding stored snapshot, and it supports the operations that are defined below.
func NewSnapshot ¶
func NewSnapshot() *Snapshot
NewSnapshot creates a new Snapshot of which lookup table is initialized.
func (*Snapshot) Pop ¶
Pop restores and the file content and delete the snapshot for restoration as well.
func (*Snapshot) Remove ¶
Remove removes the entry of filename from the snapshot lookup table; if the snapshot doesn't exist, performs no-ops.
func (*Snapshot) Restore ¶
Restore restores the snapshot of "filename". Note that the snapshot entry is not removed after the operation.