File: 09-capitalize.t

package info (click to toggle)
libvalidation-class-perl 7.900057-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 1,616 kB
  • sloc: perl: 21,493; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 431 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use Test::More tests => 1;

# load module
package MyVal;
use Validation::Class;

package main;

my $v = MyVal->new(
    fields => {foobar => {filters => 'capitalize'}},
    params => {
        foobar =>
          'i am that I am. this is not going to work. im leaving, good bye.'
    }
);

ok $v->params->{foobar}
  =~ /^I am that I am. This is not going to work. Im leaving, good bye./,
  'capitalize filter working as expected';