use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.
the class PickleRunnerWithNoStepDescriptionsTest method shouldConvertTextFromFeatureFileForNamesWithFilenameCompatibleNameOption.
@Test
void shouldConvertTextFromFeatureFileForNamesWithFilenameCompatibleNameOption() {
List<Pickle> pickles = TestPickleBuilder.picklesFromFeature("featurePath", "" + "Feature: feature name\n" + " Scenario: scenario name\n" + " Then it works\n");
PickleRunner runner = PickleRunners.withNoStepDescriptions("feature name", context, pickles.get(0), null, createFileNameCompatibleJUnitOptions());
assertThat(runner.getDescription().getDisplayName(), is(equalTo("scenario_name(feature_name)")));
}
use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.
the class NamePredicateTest method anchored_name_pattern_does_not_match_part_of_name.
@Test
void anchored_name_pattern_does_not_match_part_of_name() {
Pickle pickle = createPickleWithName("a pickle name with suffix");
NamePredicate predicate = new NamePredicate(singletonList(Pattern.compile("^a pickle name$")));
assertFalse(predicate.test(pickle));
}
use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.
the class NamePredicateTest method anchored_name_pattern_matches_exact_name.
@Test
void anchored_name_pattern_matches_exact_name() {
Pickle pickle = createPickleWithName("a pickle name");
NamePredicate predicate = new NamePredicate(singletonList(Pattern.compile("^a pickle name$")));
assertTrue(predicate.test(pickle));
}
use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.
the class CommandlineOptionsParserTest method order_type_default_none.
@Test
void order_type_default_none() {
RuntimeOptions options = parser.parse().build();
Pickle a = createPickle("file:path/file1.feature", "a");
Pickle b = createPickle("file:path/file2.feature", "b");
assertThat(options.getPickleOrder().orderPickles(Arrays.asList(a, b)), contains(a, b));
}
use of io.cucumber.core.gherkin.Pickle in project cucumber-jvm by cucumber.
the class CommandlineOptionsParserTest method ensure_order_type_reverse_is_used.
@Test
void ensure_order_type_reverse_is_used() {
RuntimeOptions options = parser.parse("--order", "reverse").build();
Pickle a = createPickle("file:path/file1.feature", "a");
Pickle b = createPickle("file:path/file2.feature", "b");
assertThat(options.getPickleOrder().orderPickles(Arrays.asList(a, b)), contains(b, a));
}
Aggregations