Re-apply based on new go flags package (#336)

This commit is contained in:
Zois Pagoulatos 2019-07-21 18:00:56 +02:00 committed by Simon Aronsson
parent 9eca883f17
commit baf5e50051
7 changed files with 58 additions and 34 deletions

View file

@ -32,9 +32,10 @@ var _ = Describe("the actions package", func() {
})
BeforeEach(func() {
client = mockClient{
api: dockerClient,
pullImages: false,
TestData: &TestData{},
api: dockerClient,
pullImages: false,
removeVolumes: false,
TestData: &TestData{},
}
})
@ -62,8 +63,9 @@ var _ = Describe("the actions package", func() {
When("given multiple containers", func() {
BeforeEach(func() {
client = mockClient{
api: dockerClient,
pullImages: false,
api: dockerClient,
pullImages: false,
removeVolumes: false,
TestData: &TestData{
NameOfContainerToKeep: "test-container-02",
Containers: []container.Container{
@ -89,8 +91,9 @@ var _ = Describe("the actions package", func() {
When("deciding whether to cleanup images", func() {
BeforeEach(func() {
client = mockClient{
api: dockerClient,
pullImages: false,
api: dockerClient,
pullImages: false,
removeVolumes: false,
TestData: &TestData{
Containers: []container.Container{
createMockContainer(
@ -134,9 +137,10 @@ func createMockContainer(id string, name string, image string, created time.Time
}
type mockClient struct {
TestData *TestData
api cli.CommonAPIClient
pullImages bool
TestData *TestData
api cli.CommonAPIClient
pullImages bool
removeVolumes bool
}
type TestData struct {

View file

@ -14,10 +14,10 @@ var (
// UpdateParams contains all different options available to alter the behavior of the Update func
type UpdateParams struct {
Filter container.Filter
Cleanup bool
NoRestart bool
Timeout time.Duration
Filter container.Filter
Cleanup bool
NoRestart bool
Timeout time.Duration
MonitorOnly bool
}