use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.
the class TagPredicateTest method not_tag_predicate_matches_pickle_with_no_tags.
@Test
void not_tag_predicate_matches_pickle_with_no_tags() {
Pickle pickle = createPickleWithTags();
TagPredicate predicate = createPredicate("not @FOO");
assertTrue(predicate.test(pickle));
}
use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.
the class PickleOrderTest method reverse_lexical_uri_order.
@Test
void reverse_lexical_uri_order() {
when(firstPickle.getUri()).thenReturn(URI.create("file:com/example/a.feature"));
when(firstPickle.getLocation()).thenReturn(new Location(2, -1));
when(secondPickle.getUri()).thenReturn(URI.create("file:com/example/a.feature"));
when(secondPickle.getLocation()).thenReturn(new Location(3, -1));
when(thirdPickle.getUri()).thenReturn(URI.create("file:com/example/b.feature"));
PickleOrder order = StandardPickleOrders.reverseLexicalUriOrder();
List<Pickle> pickles = order.orderPickles(Arrays.asList(secondPickle, thirdPickle, firstPickle));
assertThat(pickles, contains(thirdPickle, secondPickle, firstPickle));
}
use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.
the class PickleOrderTest method lexical_uri_order.
@Test
void lexical_uri_order() {
when(firstPickle.getUri()).thenReturn(URI.create("file:com/example/a.feature"));
when(firstPickle.getLocation()).thenReturn(new Location(2, -1));
when(secondPickle.getUri()).thenReturn(URI.create("file:com/example/a.feature"));
when(secondPickle.getLocation()).thenReturn(new Location(3, -1));
when(thirdPickle.getUri()).thenReturn(URI.create("file:com/example/b.feature"));
PickleOrder order = StandardPickleOrders.lexicalUriOrder();
List<Pickle> pickles = order.orderPickles(Arrays.asList(thirdPickle, secondPickle, firstPickle));
assertThat(pickles, contains(firstPickle, secondPickle, thirdPickle));
}
use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.
the class PickleRunnerWithStepDescriptionsTest method shouldUseStepKeyworkAndNameForChildName.
@Test
void shouldUseStepKeyworkAndNameForChildName() {
List<Pickle> pickles = picklesFromFeature("featurePath", "" + "Feature: feature name\n" + " Scenario: scenario name\n" + " Then it works\n");
PickleRunner runner = PickleRunners.withStepDescriptions(context, pickles.get(0), null, createJunitOptions());
assertEquals("it works", runner.getDescription().getChildren().get(0).getMethodName());
}
use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.
the class PickleRunnerWithStepDescriptionsTest method shouldConvertTextFromFeatureFileForNamesWithFilenameCompatibleNameOption.
@Test
void shouldConvertTextFromFeatureFileForNamesWithFilenameCompatibleNameOption() {
List<Pickle> pickles = picklesFromFeature("featurePath", "" + "Feature: feature name\n" + " Scenario: scenario name\n" + " Then it works\n");
PickleRunner runner = PickleRunners.withStepDescriptions(context, pickles.get(0), null, createFileNameCompatibleJunitOptions());
assertEquals("scenario_name", runner.getDescription().getDisplayName());
assertEquals("scenario_name", runner.getDescription().getChildren().get(0).getClassName());
assertEquals("it_works", runner.getDescription().getChildren().get(0).getMethodName());
}
Aggregations