Skip to content

Commit

Permalink
support whitespaces for NumericCode
Browse files Browse the repository at this point in the history
  • Loading branch information
dionys committed Mar 28, 2015
1 parent 4c980f8 commit f5cbd7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Types/Common/String.pm
Expand Up @@ -60,7 +60,7 @@ $meta->add_type(
);

NumericCode->coercion->add_type_coercions(
NonEmptySimpleStr, q[ do { (my $code = $_) =~ s/[[:punct:]]//g; $code } ],
NonEmptySimpleStr, q[ do { (my $code = $_) =~ s/[[:punct:][:space:]]//g; $code } ],
);

$meta->add_type(
Expand Down
1 change: 1 addition & 0 deletions t/20-unit/Types-Common-String/coerce.t
Expand Up @@ -54,5 +54,6 @@ is(to_UpperCaseStr('foo'), 'FOO', 'uppercase str' );
is(to_LowerCaseStr('BAR'), 'bar', 'lowercase str' );

is(to_NumericCode('4111-1111-1111-1111'), '4111111111111111', 'numeric code' );
is(to_NumericCode('+1 (800) 555-01-23'), '18005550123', 'numeric code' );

done_testing;

0 comments on commit f5cbd7f

Please sign in to comment.