Catalyst-Plugin-Assets

 view release on metacpan or  search on metacpan

t/002-assets.t  view on Meta::CPAN


alert("Automatically " + auto);

/* Test js file for root/static/concat.js */
_END_

is(t::TestCatalyst->scratch->read("root/static/concat/assets.css"), <<_END_);
/* Test css file for auto.css */

div.auto {
    font-weight: bold;
    color: green;
}

/* Comment at the end */

/* Test css file for root/static/concat.css */
_END_

t/004-caching.t  view on Meta::CPAN


my $response;
ok($response = request('http://localhost/'));

ok($response = request('http://localhost/fruit-salad'));
compare($response->content, qw(  
    http://localhost/assets.css
    http://localhost/assets.js
));

is(sanitize $scratch->read("root/assets.css"), "div.auto{font-weight:bold;color:green}div.apple{color:red}div.apple{color:blue}");
is($scratch->read("root/assets.js"), 'function calculate(){return 1*30/23;}
var auto=8+4;alert("Automatically "+auto);var apple=1+4;alert("Apple is "+apple);');

my $mtime = $scratch->stat("root/assets.css")->mtime;

sleep 2;

ok($response = request('http://localhost/fruit-salad'));
compare($response->content, qw(  
    http://localhost/assets.css
    http://localhost/assets.js
));

is(sanitize $scratch->read("root/assets.css"), "div.auto{font-weight:bold;color:green}div.apple{color:red}div.apple{color:blue}");
is($scratch->stat("root/assets.css")->mtime, $mtime);

$scratch->write("root/static/auto.css", <<_END_);
/* New auto content! */

div.auto 

{
    border: 1px solid #aaa;
    color: black;

t/010-configuration-minify-1.t  view on Meta::CPAN

my $scratch = t::TestCatalystMinify1->scratch;
my $response;
ok($response = request('http://localhost/'));

ok($response = request('http://localhost/fruit-salad'));
compare($response->content, qw(  
    http://localhost/assets.css
    http://localhost/assets.js
));

is(sanitize $scratch->read("root/assets.css"), "div.auto{font-weight:bold;color:green}div.apple{color:red}div.apple{color:blue}");
is($scratch->read("root/assets.js"), 'function calculate(){return 1*30/23;}
var auto=8+4;alert("Automatically "+auto);var apple=1+4;alert("Apple is "+apple);');

t/011-configuration-minify-yuicompressor.t  view on Meta::CPAN

my $scratch = t::TestCatalystMinifyYUICompressor->scratch;
my $response;
ok($response = request('http://localhost/'));

ok($response = request('http://localhost/fruit-salad'));
compare($response->content, qw(  
    http://localhost/assets.css
    http://localhost/assets.js
));

is($scratch->read("root/assets.css"), "div.auto{font-weight:bold;color:green;}div.apple{color:red;}div.apple{color:blue;}");
is($scratch->read("root/assets.js"), 'function calculate(){return 1*30/23}var auto=8+4;alert("Automatically "+auto);var apple=1+4;alert("Apple is "+apple)')

t/012-configuration-pathing.t  view on Meta::CPAN

my $scratch = t::TestCatalystPathing->scratch;
my $response;
ok($response = request('http://localhost/'));

ok($response = request('http://localhost/fruit-salad'));
compare($response->content, qw(  
    http://localhost/static/built/assets.css
    http://localhost/static/built/assets.js
));

is(sanitize $scratch->read("root/static/built/assets.css"), "div.auto{font-weight:bold;color:green}div.apple{color:red}div.apple{color:blue}");
is($scratch->read("root/static/built/assets.js"), 'function calculate(){return 1*30/23;}
var auto=8+4;alert("Automatically "+auto);var apple=1+4;alert("Apple is "+apple);')

t/TestCatalystBase.pm  view on Meta::CPAN


div.apple {
    color: blue;
}
_END_

    'root/static/auto.css' => <<_END_,
/* Test css file for auto.css */

div.auto {
    font-weight: bold;
    color: green;
}

/* Comment at the end */
_END_

    'root/static/apple.js' => <<_END_,
/* Test js file for apple.js */

var apple = 1 + 4;



( run in 0.492 second using v1.01-cache-2.11-cpan-3989ada0592 )