| 1 | package Test::BDD::Cucumber::Definitions::File::In; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | use utf8; | ||
| 6 | |||
| 7 | use Test::BDD::Cucumber::Definitions qw(Given When Then); | ||
| 8 | use Test::BDD::Cucumber::Definitions::File qw(File); | ||
| 9 | |||
| 10 | our $VERSION = '0.41'; | ||
| 11 | |||
| 12 | ## no critic [RegularExpressions::ProhibitCaptureWithoutTest] | ||
| 13 | ## no critic [RegularExpressions::RequireExtendedFormatting] | ||
| 14 | ## no critic [RegularExpressions::ProhibitComplexRegexes] | ||
| 15 | |||
| 16 | sub import { | ||
| 17 | |||
| 18 | # file path set "(.*)" | ||
| 19 | Given qr/file path set "(.*)"/, sub { | ||
| 20 | File->path_set($1); | ||
| 21 | }; | ||
| 22 | |||
| 23 | # file read text "(.*)" | ||
| 24 | When qr/file read text "(.*)"/, sub { | ||
| 25 | File->read_text($1); | ||
| 26 | }; | ||
| 27 | |||
| 28 | # file read binary | ||
| 29 | When qr/file read binary/, sub { | ||
| 30 | File->read_binary(); | ||
| 31 | }; | ||
| 32 | |||
| 33 | # file exists | ||
| 34 | Then qr/file exists/, sub { | ||
| 35 | File->exists_yes(); | ||
| 36 | }; | ||
| 37 | |||
| 38 | # file not exists | ||
| 39 | Then qr/file not exists/, sub { | ||
| 40 | File->exists_no(); | ||
| 41 | }; | ||
| 42 | |||
| 43 | # file type is "(.*)" | ||
| 44 | Then qr/file type is "(.*)"/, sub { | ||
| 45 | File->type_is($1); | ||
| 46 | }; | ||
| 47 | |||
| 48 | return; | ||
| 49 | } | ||
| 50 | |||
| 51 | 1; |