File: normalize-booleans.t

package info (click to toggle)
libtwitter-api-perl 1.0006-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 424 kB
  • sloc: perl: 2,868; makefile: 7
file content (33 lines) | stat: -rw-r--r-- 541 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!perl
use 5.14.1;
use warnings;

use Test::More;

package Foo {
    use Moo;
    with 'Twitter::API::Trait::NormalizeBooleans';

    # required
    sub preprocess_args {}
}

my $args = {
    foo           => 'bar',
    include_email => 1,
    skip_user     => 't',
    skip_status   => '',
    text          => 'test',
};

my $foo = Foo->new;
$foo->normalize_bools($args);

is_deeply $args, {
    foo           => 'bar',
    include_email => 'true',
    skip_user     => 'true',
    text          => 'test',
}, 'normalized';

done_testing;