Code Monkey home page Code Monkey logo

p5-catalystx-test-most's Introduction

Name
    CatalystX::Test::Most - Test base pulling in Catalyst::Test, Test::More,
    Test::Fatal, and HTTP::Request::Common for unit tests on Catalyst
    applications.

Synopsis
     use CatalystX::Test::Most "MyApp";

     subtest "Tests with plain Catalyst::Test" => sub {
         ok request("/")->is_success, "/ is okay";
         is exception { request("/no-such-uri") }, undef,
            "404s do not throw exceptions";
         is request("/no-such-uri")->code, 404, "And do return 404";
     };

     subtest "Tests with Test::WWW::Mechanize::Catalyst" => sub {
        my $mech = mech();
        $mech->get_ok("/", "GET /");
        $mech->content_contains("OHAI", "That's my app all right");
     };

     done_testing();

     #    ok 1 - / is okay
     #    ok 2 - 404s do not throw exceptions
     #    ok 3 - And do return 404
     #    1..3
     # ok 2 - Tests with plain Catalyst::Test
     #    ok 1 - GET /
     #    ok 2 - My app all right
     #    1..2
     # ok 3 - Tests with Test::WWW::Mechanize::Catalyst

Exported Functions from Other Packages
  Catalyst::Test
    Everything, so see its documentation: Catalyst::Test.
    CatalystX::Test::Most is basically an overloaded version of it.

  Test::More
    All of its exported functions; see its documentation: Test::More.

  Test::Fatal
    See "exception" in Test::Fatal.

  Test::WWW::Mechanize::Catalyst
    You have easy access to a Test::WWW::Mechanize::Catalyst object. There
    are no related functions, just the object methods.

New Functions
    *   "ctx"

        This is a wrapper to get the context object. It will only work on
        local tests (not remote servers).

    *   "mech"

        Get a Test::WWW::Mechanize::Catalyst object. Unless specified, the
        app name and the arguments are recycled from the "import" of
        CatalystX::Test::Most.

Notes
    strictures are exported.

Copyright and License
    Ashley Pond V. Artistic License 2.0.

p5-catalystx-test-most's People

Contributors

pangyre avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.