App-FuguVM

 view release on metacpan or  search on metacpan

t/fuguvm/proxy.t  view on Meta::CPAN

	ok( $on->is_cacheable($distfile),
	    'a distfile is cacheable with a cap above 0' );
	ok( $on->is_cacheable($nested),
	    'a distfile in a subdirectory is cacheable' );
	ok( !$on->is_cacheable(
		'http://cdn.openbsd.org/pub/OpenBSD/distfiles/'),
	    'a directory listing with a trailing solidus is not' );
	is( $on->distfile_limit, 4096, 'the cap is on the object' );
}

# A kernel has no extension, so the generic content-type table cannot
# name it. The policy adds that entry.
{
	my $cache = App::FuguVM::Proxy::Cache->new( tempdir( CLEANUP => 1 ) );

	is( $cache->content_type('/pub/OpenBSD/7.8/arm64/bsd'),
	    'application/octet-stream', 'a kernel is bytes' );
	is( $cache->content_type('/pub/OpenBSD/7.8/arm64/base78.tgz'),
	    'application/x-gzip', 'and the generic table still applies' );
}



( run in 2.661 seconds using v1.01-cache-2.11-cpan-800906f7e73 )