App-CatalystStarter-Bloated

 view release on metacpan or  search on metacpan

t/initializr/process_zip.t  view on Meta::CPAN

use_ok "App::CatalystStarter::Bloated::Initializr";

*az = *App::CatalystStarter::Bloated::Initializr::_az;

## some basic functions for control and setup

note( "zip setup and safely check tests" );

is( az(), undef, "az undef before init" );

throws_ok { App::CatalystStarter::Bloated::Initializr::_require_az() }
    qr/^\Qaz object not initialized/, "az check dies as expected before init";

isa_ok(
    App::CatalystStarter::Bloated::Initializr::_set_az_from_cache(),
    "Archive::Zip"
);

isa_ok( az(), "Archive::Zip",
        "az after init" );

lives_ok { App::CatalystStarter::Bloated::Initializr::_require_az() }
    "az check lives after init";

note( "zip accessor tests" );

## search one

*search_one = *App::CatalystStarter::Bloated::Initializr::_safely_search_one_member;

throws_ok { search_one(qr/./) }
    qr/^\QFound 0 or more than one zip member match for/,
    "safe search dies on > 1 matches";

throws_ok { search_one(qr/THIS SHOULD NOT BE IN ANY OF THE ZIP MEMBERS/) }
    qr/^\QFound 0 or more than one zip member match for/,
    "a non matching qr also dies";

lives_ok { search_one(qr/THIS SHOULD NOT BE IN ANY OF THE ZIP MEMBERS/, 1) }
    "a non matching qr lives when allowed to";

isa_ok( search_one( qr(^initializr/index\.html$) ), "Archive::Zip::Member",
        "index.html" );

## content related



( run in 0.251 second using v1.01-cache-2.11-cpan-496ff517765 )