Skip to content

Commit

Permalink
Merge pull request #126 from iamdanfox/no-options-helper-method
Browse files Browse the repository at this point in the history
Add a noOptions method to DockerComposeExecOption
  • Loading branch information
iamdanfox authored Nov 4, 2016
2 parents 3b436c3 + 0052238 commit 0038c4c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/
package com.palantir.docker.compose.execution;

import com.google.common.collect.ImmutableList;
import java.util.Arrays;
import java.util.List;

import org.immutables.value.Value;

@Value.Immutable
Expand All @@ -28,4 +28,8 @@ public abstract class DockerComposeExecOption {
public static DockerComposeExecOption options(String... options) {
return ImmutableDockerComposeExecOption.of(Arrays.asList(options));
}

public static DockerComposeExecOption noOptions() {
return ImmutableDockerComposeExecOption.of(ImmutableList.of());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.palantir.docker.compose.execution;

import static com.palantir.docker.compose.execution.DockerComposeExecOption.noOptions;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsEmptyCollection.empty;

import org.junit.Test;

public class DockerComposeExecOptionShould {

@Test public void
be_constructable_with_no_args() {
DockerComposeExecOption option = noOptions();
assertThat(option.options(), empty());
}
}

0 comments on commit 0038c4c

Please sign in to comment.