Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep for dancer2 1.0.0 #1

Merged
merged 3 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion META.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"test" : {
"requires" : {
"Dancer2" : "0",
"Dancer2::Test" : "0",
"Plack::Test" : "0",
"ExtUtils::MakeMaker" : "0",
"File::Find" : "0",
"File::Spec::Functions" : "0",
Expand Down
15 changes: 9 additions & 6 deletions README.pod
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
=pod

=encoding UTF-8

=head1 NAME

Dancer2::Plugin::Syntax::GetPost - Syntactic sugar for GET+POST handlers

=head1 VERSION

version 0.002
version 0.003

=head1 SYNOPSIS

Expand Down Expand Up @@ -37,34 +39,35 @@ L<Dancer2>

=back

=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
=for :stopwords cpan testmatrix url bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan

=head1 SUPPORT

=head2 Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracker
at L<https://github.com/dagolden/dancer2-plugin-syntax-getpost/issues>.
at L<https://github.com/PerlDancer/dancer2-plugin-syntax-getpost/issues>.
You will be notified automatically of any progress on your issue.

=head2 Source Code

This is open source software. The code repository is available for
public review and contribution under the terms of the license.

L<https://github.com/dagolden/dancer2-plugin-syntax-getpost>
L<https://github.com/PerlDancer/dancer2-plugin-syntax-getpost>

git clone git://github.com/dagolden/dancer2-plugin-syntax-getpost.git
git clone https://github.com/PerlDancer/dancer2-plugin-syntax-getpost.git

=head1 AUTHOR

David Golden <dagolden@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2012 by David Golden.
This software is Copyright (c) 2023 by David Golden.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004

=cut
7 changes: 5 additions & 2 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ name = Dancer2-Plugin-Syntax-GetPost
author = David Golden <dagolden@cpan.org>
license = Apache_2_0
copyright_holder = David Golden
copyright_year = 2012
copyright_year = 2023
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's quite the bump!


[@DAGOLDEN]
:version = 0.032
-remove = MetaJSON
-remove = PodCoverageTests
-remove = Test::Version
AutoMetaResources.bugtracker.rt = 0
AutoMetaResources.bugtracker.github = user:dagolden
AutoMetaResources.bugtracker.github = user:perldancer

32 changes: 23 additions & 9 deletions t/getpost.t
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
use strict;
use warnings;
use Test::More 0.96 import => ['!pass'];
use Plack::Test;
use HTTP::Request::Common;

use Dancer2;
use Dancer2::Test;
use Dancer2::Plugin::Syntax::GetPost;
{
package TestApp;

get_post '/form' => sub { return "method = " . request->method };
use Dancer2;
use Dancer2::Plugin::Syntax::GetPost;

route_exists [ GET => '/form' ];
route_exists [ POST => '/form' ];
route_doesnt_exist [ PUT => '/form' ];
response_content_like [ GET => '/form' ], qr/method = GET/;
response_content_like [ POST => '/form' ], qr/method = POST/;
get_post '/form' => sub { return "method = " . request->method };

1;
}

my $app = Plack::Test->create( TestApp->to_app );

my $res = $app->request( GET '/form' );
is( $res->code, 200, 'GET /form exists' );
like( $res->content, qr/method = GET/, 'GET content matches expected output' );

$res = $app->request( POST '/form' );
is( $res->code, 200, 'POST /form exists' );
like( $res->content, qr/method = POST/, 'POST content matches expected output' );

$res = $app->request( PUT '/form' );
is( $res->code, 404, 'PUT /form does not exist' );

done_testing;
# COPYRIGHT