Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsamwell committed Sep 15, 2021
2 parents 3971045 + b231e7c commit 239a4ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ To run this example:
1. Ensure dart is accessible in the command line (on your path variable)
2. In a command prompt (from the root of this library):
```bash
dart pub get
cd example

dart test.dart
Expand Down
11 changes: 11 additions & 0 deletions example/test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:gherkin/gherkin.dart';
import 'supporting_files/hooks/hook_example.dart';
import 'supporting_files/parameters/power_of_two.parameter.dart';
Expand All @@ -10,6 +11,14 @@ import 'supporting_files/steps/when_numbers_are_added.step.dart';
import 'supporting_files/steps/when_the_characters_are_counted.step.dart';
import 'supporting_files/worlds/custom_world.world.dart';

String buildFeaturesPathRegex() {
// '\' must be escaped, '/' must not be escaped:
var featuresPath = (Platform.isWindows)
? 'features\${Platform.pathSeparator}.*\.feature'
: 'features${Platform.pathSeparator}.*\.feature';
return featuresPath;
}

Future<void> main() {
final steps = [
GivenTheNumbers(),
Expand All @@ -19,7 +28,9 @@ Future<void> main() {
WhenTheCharactersAreCounted(),
ThenExpectNumericResult()
];
final featuresPath = buildFeaturesPathRegex();
final config = TestConfiguration.DEFAULT(steps)
..features = [RegExp(featuresPath)]
..tagExpression = 'not @skip'
..hooks = [HookExample()]
..customStepParameterDefinitions = [PowerOfTwoParameter()]
Expand Down

0 comments on commit 239a4ca

Please sign in to comment.