The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
#!perl

use strict;
use warnings;

use Test::More;
use Test::BDD::Cucumber::Parser;

my $feature = Test::BDD::Cucumber::Parser->parse_file(
	'examples/digest/features/basic.feature' );

# Check that we have three scenarios
my @scenarios = @{ $feature->scenarios };

for my $scenario_name (
	'Check MD5',
	'Check SHA-1',
	'MD5 longer data'
) {
	my $scenario = shift( @scenarios );
	ok( $scenario, "Scenario found" );
	is( $scenario->name || '', $scenario_name,
		"Scenario name matches: " . $scenario_name );
}

ok( $feature->background, "Background section exists" );

done_testing();