File: CSSUnminifier.pm

package info (click to toggle)
libcode-tidyall-perl 0.83~ds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,036 kB
  • sloc: perl: 5,240; lisp: 47; makefile: 2; sh: 1
file content (28 lines) | stat: -rw-r--r-- 786 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
package TestFor::Code::TidyAll::Plugin::CSSUnminifier;

use Path::Tiny qw( cwd );
use Test::Class::Most parent => 'TestFor::Code::TidyAll::Plugin';

sub _extra_path {
    cwd()->child(qw( node_modules .bin ));
}

sub test_main : Tests {
    my $self = shift;

    return unless $self->require_executable('node');
    return unless $self->require_executable('cssunminifier');

    my $source = "body {\nfont-family:helvetica;\nfont-size:15pt;\n}";
    $self->tidyall(
        source      => $source,
        expect_tidy => "body {\n    font-family: helvetica;\n    font-size: 15pt;\n}\n"
    );
    $self->tidyall(
        source      => $source,
        conf        => { argv => '-w=2' },
        expect_tidy => "body {\n  font-family: helvetica;\n  font-size: 15pt;\n}\n"
    );
}

1;