// Path: src/main/java/com/xebialabs/overcast/command/Command.java
// public static Command aCommand(String executable) {
//     if (executable == null) {
//         throw new IllegalArgumentException("Executable can not be null");
//     }
//     Command c = new Command();
//     c.withPart(executable);
//     return c;
// }
// 
// Path: src/main/java/com/xebialabs/overcast/command/CommandProcessor.java
// public static CommandProcessor atLocation(String l) {
//     return new CommandProcessor(l);
// }


import org.junit.jupiter.api.Test;
import static com.xebialabs.overcast.command.Command.aCommand;
import static com.xebialabs.overcast.command.CommandProcessor.atLocation;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
/**
 *    Copyright 2012-2021 Digital.ai
 *
 *    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.xebialabs.overcast.command;



public class CommandProcessorTest {

    @Test
    public void shouldThrowExceptionWhenCommandFailed() {
        //Test only for UNIX
        assumeTrue(System.getenv().containsKey("PATH"));

// Path: src/main/java/com/xebialabs/overcast/command/Command.java
// public static Command aCommand(String executable) {
//     if (executable == null) {
//         throw new IllegalArgumentException("Executable can not be null");
//     }
//     Command c = new Command();
//     c.withPart(executable);
//     return c;
// }
// 
// Path: src/main/java/com/xebialabs/overcast/command/CommandProcessor.java
// public static CommandProcessor atLocation(String l) {
//     return new CommandProcessor(l);
// }


// Path: src/test/java/com/xebialabs/overcast/command/CommandProcessorTest.java
import org.junit.jupiter.api.Test;
import static com.xebialabs.overcast.command.Command.aCommand;
import static com.xebialabs.overcast.command.CommandProcessor.atLocation;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assumptions.assumeTrue;

/**
 *    Copyright 2012-2021 Digital.ai
 *
 *    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.xebialabs.overcast.command;



public class CommandProcessorTest {

    @Test
    public void shouldThrowExceptionWhenCommandFailed() {
        //Test only for UNIX
        assumeTrue(System.getenv().containsKey("PATH"));

        assertThrows(NonZeroCodeException.class, () -> {