forked from cucumber/cucumber-jvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fail if no features are found. Closes cucumber#163
- Loading branch information
1 parent
894cf1c
commit 287bf9b
Showing
5 changed files
with
32 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
core/src/test/java/cucumber/runtime/model/CucumberFeatureTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package cucumber.runtime.model; | ||
|
||
import cucumber.io.Resource; | ||
import cucumber.io.ResourceLoader; | ||
import cucumber.runtime.CucumberException; | ||
import org.junit.Test; | ||
|
||
import java.util.Collections; | ||
|
||
import static java.util.Arrays.asList; | ||
import static java.util.Collections.emptyList; | ||
import static org.mockito.Matchers.anyString; | ||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.when; | ||
|
||
public class CucumberFeatureTest { | ||
@Test(expected = CucumberException.class) | ||
public void fails_if_no_features_are_found() { | ||
ResourceLoader resourceLoader = mock(ResourceLoader.class); | ||
when(resourceLoader.resources(anyString(), anyString())).thenReturn(Collections.<Resource>emptyList()); | ||
CucumberFeature.load(resourceLoader, asList("does/not/exit"), emptyList()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters