Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let the TestNG runner handle strict mode correctly #719

Merged
merged 1 commit into from
Jun 26, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ public void runCukes() {
} catch (IOException ex) {
throw new RuntimeException(ex);
}
runtime.printSummary();
if (!runtime.getErrors().isEmpty()) {
throw new CucumberException(runtime.getErrors().get(0));
} else if (runtime.exitStatus() != 0x00) {
throw new CucumberException("There are pending or undefined steps.");
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package cucumber.api.testng;

import cucumber.runtime.CucumberException;
import cucumber.runtime.testng.RunCukesStrict;
import org.testng.annotations.Test;

public class TestNGCucumberRunnerTest {

@Test(expectedExceptions = CucumberException.class)
public void runCukesStrict() throws Exception {
TestNGCucumberRunner testNGCucumberRunner = new TestNGCucumberRunner(RunCukesStrict.class);
testNGCucumberRunner.runCukes();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package cucumber.runtime.testng;

import cucumber.api.CucumberOptions;
import cucumber.api.testng.AbstractTestNGCucumberTests;

@CucumberOptions(strict = true)
public class RunCukesStrict extends AbstractTestNGCucumberTests {
}