Author image Bartosz Jarzyna

NAME

Kelp::Module::Symbiosis::Test - Allow testing symbiotic environments using Kelp::Test

SYNOPSIS

        # in test file
        use Kelp::Module::Symbiosis::Test;

        my $app = Kelp::Module::Symbiosis::Test->new(app => $kelp_app);
        my $t = Kelp::Test->new(app => $app);

        # continue testing using $t

DESCRIPTION

This module allows testing Kelp apps with Symbiosis using Kelp::Test. The problem with Kelp::Test is that it automatically runs run() on the app without any way to configure this behavior. Symbiotic apps use run_all() to run the whole environment, while run() stays the same and only runs Kelp. This module replaces those two methods and autoloads the rest of the methods from Kelp instance.

USAGE

Before passing the main Kelp instance into Kelp::Test wrap it in this module using the constructor and pass the resulting application instead. Then you can create test cases not only for Kelp routes but also for the rest of Plack applications.