diff options
Diffstat (limited to 't')
-rw-r--r-- | t/bar.css | 4 | ||||
-rw-r--r-- | t/foo.less | 9 | ||||
-rw-r--r-- | t/less.t | 28 |
3 files changed, 41 insertions, 0 deletions
diff --git a/t/bar.css b/t/bar.css new file mode 100644 index 0000000..b8c021f --- /dev/null +++ b/t/bar.css @@ -0,0 +1,4 @@ +#data { + float: left; + margin-left: 10px; +} diff --git a/t/foo.less b/t/foo.less new file mode 100644 index 0000000..deb790c --- /dev/null +++ b/t/foo.less @@ -0,0 +1,9 @@ +@brand_color: #4D926F; + +#header { + color: @brand_color; +} + +h2 { + color: @brand_color; +} diff --git a/t/less.t b/t/less.t new file mode 100644 index 0000000..9be599f --- /dev/null +++ b/t/less.t @@ -0,0 +1,28 @@ +use strict; +use Plack::App::File; +use Plack::Middleware::File::Less; +use Test::More; +use Plack::Test; +use HTTP::Request::Common; + +my $app = Plack::App::File->new(root => "t"); +$app = Plack::Middleware::File::Less->wrap($app); + +test_psgi $app, sub { + my $cb = shift; + + my $res = $cb->(GET "/"); + is $res->code, 404; + + $res = $cb->(GET "/foo.css"); + is $res->code, 200; + is $res->content_type, 'text/css'; + like $res->content, qr/color: #4D926F;/; + + $res = $cb->(GET "/bar.css"); + is $res->code, 200; + is $res->content_type, 'text/css'; + like $res->content, qr/float: left/; +}; + +done_testing; |