{"id":17109599,"url":"https://github.com/monken/p5-catalystx-test-recorder","last_synced_at":"2025-03-23T21:41:34.872Z","repository":{"id":769480,"uuid":"453743","full_name":"monken/p5-catalystx-test-recorder","owner":"monken","description":"Generate tests from HTTP requests","archived":false,"fork":false,"pushed_at":"2011-01-15T16:25:36.000Z","size":104,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-29T05:13:38.780Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monken.png","metadata":{"files":{"readme":"README.pod","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-12-30T20:14:07.000Z","updated_at":"2014-09-08T20:44:54.000Z","dependencies_parsed_at":"2022-07-18T12:48:16.348Z","dependency_job_id":null,"html_url":"https://github.com/monken/p5-catalystx-test-recorder","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monken%2Fp5-catalystx-test-recorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monken%2Fp5-catalystx-test-recorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monken%2Fp5-catalystx-test-recorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monken%2Fp5-catalystx-test-recorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monken","download_url":"https://codeload.github.com/monken/p5-catalystx-test-recorder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245175323,"owners_count":20572781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T16:23:43.423Z","updated_at":"2025-03-23T21:41:34.850Z","avatar_url":"https://github.com/monken.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"package CatalystX::Test::Recorder;\n\nuse strict;\nuse warnings;\nuse Moose::Role;\nuse List::Util qw(first);\n\n\naround locate_components =\u003e sub {\n    my $orig = shift;\n    my $self = shift;\n    my @components = $self-\u003e$orig(@_);\n    push(@components, 'CatalystX::Test::Recorder::Controller');\n    return @components;\n};\n\nafter finalize =\u003e sub {\n    my $c = shift;\n    return unless $CatalystX::Test::Recorder::Controller::record;\n    my $config = CatalystX::Test::Recorder::Controller-\u003econfig;\n    return if(first { $c-\u003ereq-\u003epath =~ $_ } @{$config-\u003e{skip}});\n    push(@{$CatalystX::Test::Recorder::Controller::requests}, $c-\u003ereq);\n    push(@{$CatalystX::Test::Recorder::Controller::responses}, $c-\u003eres);\n    \n};\n\n1;\n\n__END__\n\n=head1 NAME\n\nCatalystX::Test::Recorder - Generate tests from HTTP requests\n\n=head1 SYNOPSIS\n\n  package MyApp;\n  use Moose;\n  extends 'Catalyst';\n  __PACKAGE__-\u003esetup(qw(+CatalystX::Test::Recorder));\n  1;\n  \n  # hit /recorder/start to start recording\n  # make requests to your application\n  # hit /recorder/stop to get the test\n\nExample output: \n\n  use Test::More;\n  use strict;\n  use warnings;\n\n  use URI;\n  use HTTP::Request::Common qw(GET HEAD PUT DELETE POST);\n\n  use Test::WWW::Mechanize::Catalyst 'MyApp';\n\n  my $mech = Test::WWW::Mechanize::Catalyst-\u003enew();\n  $mech-\u003erequests_redirectable([]); # disallow redirects\n\n  my ( $response, $request, $url );\n\n  $request = POST '/foo', [ 'foo' =\u003e 'bar' ];\n  $response = $mech-\u003erequest($request);\n  is( $response-\u003ecode, 200 );\n\n  $url = URI-\u003enew('/foo');\n  $url-\u003equery_form( { 'foo' =\u003e 'bar' } );\n  $request = GET $url;\n  $response = $mech-\u003erequest($request);\n\n  done_testing;\n  \n=head1 DESCRIPTION\n\nIn order to test your application thoroughly you have to write a lot of tests, to ensure all controllers\nand actions are set up properly. This can be quite a pain, especially for large forms and complex business logic.\n\nThis module provides a test skeleton from HTTP requests to your application. It captures body parameters as well\nas query parameters and handles all HTTP request methods. The generated test checks the response code only. This is\nwhere the real work begins. See L\u003cTest::WWW::Mechanize::Catalyst\u003e for more testing goodness.\n\nThis plugin should only be used in a development environment.\n\n=head1 CONFIGURATION\n\n  package MyApp;\n  ...\n  __PACKAGE__-\u003econfig( 'CatalystX::Test::Recorder' =\u003e {\n    namespace =\u003e '...',\n    ...\n  } );\n\n=head2 namespace\n\nSets the namespace under which the start and stop actions are located. Defaults to C\u003crecorder\u003e.\n\n=head2 skip\n\nThis is an arrayref of regexprefs. Requests, whose path matches on of these regexes, will not be recorded.\nDefaults to C\u003cqr/^static\\//, qr/^favicon.ico/\u003e.\n\n=head2 template\n\nSpecify the path to a L\u003cTemplate::Alloy\u003e (TT dialect) file which is used to render the test. \nFor reference, the default template is available in the C\u003c__DATA__\u003e section of C\u003cCatalystX::Test::Recorder::Controller\u003e.\n\nThe following variables are avaiable from the template:\n\n=over\n\n=item * requests\n\nAn arrayref of L\u003cCatalyst::Request\u003e objects.\n\n=item * responses\n\nAn arrayref of L\u003cCatalyst::Response\u003e objects.\n\n=item * app\n\nThe name of the current application.\n\n=back\n\n=head1 AUTHOR\n\nMoritz Onken, C\u003conken@netcubed.de\u003e\n\n=head1 COPYRIGHT AND LICENSE\n\nThis software is Copyright (c) 2010 by Moritz Onken.\n\nThis is free software, licensed under:\n\n  The (three-clause) BSD License\n\n=cut","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonken%2Fp5-catalystx-test-recorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonken%2Fp5-catalystx-test-recorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonken%2Fp5-catalystx-test-recorder/lists"}