Skip to content

Commit

Permalink
Minor adjustments based on review feedback from Erik
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbn committed Feb 3, 2021
1 parent 7f8ba03 commit fd15817
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions t/validator_matches_date_format.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@ dies_ok { $validator = Workflow::Validator::MatchesDateFormat->new({}) } 'Constr

dies_ok { $validator = Workflow::Validator::MatchesDateFormat->new({ date_format => bless {} }) } 'Constructor with bad parameters, we die';

ok($validator = Workflow::Validator::MatchesDateFormat->new({
lives_and { $validator = Workflow::Validator::MatchesDateFormat->new({
date_format => '%Y-%m-%d',
}), 'Constructor with date_format provided, should succeed');
}), $validator } 'Constructor with date_format provided, should succeed';

if (! $validator) {
BAIL_OUT 'validator construction failed';
}

isa_ok($validator, 'Workflow::Validator');

ok($validator->validate($wf, '2005-05-13'), 'validating a legal date');
lives_ok { $validator->validate($wf, '2005-05-13') } 'validating a legal date';

lives_ok { $validator->validate($wf, '2005-05-13') } 'validating a legal date';

lives_ok { $validator->validate($wf) } 'Validation without parameters, we live';

Expand Down

0 comments on commit fd15817

Please sign in to comment.