Skip to content

Commit

Permalink
improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wollmers committed Apr 29, 2015
1 parent a229234 commit e8582c3
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 35 deletions.
15 changes: 11 additions & 4 deletions .travis.yml
Expand Up @@ -6,8 +6,15 @@ perl:
- "5.14"
- "5.12"
- "5.10"
before_install:
cpanm -n Devel::Cover &&
cpanm -n Devel::Cover::Report::Coveralls

install:
- export RELEASE_TESTING=1 AUTOMATED_TESTING=1 AUTHOR_TESTING=1 HARNESS_OPTIONS=c HARNESS_TIMER=1
- cpanm --quiet --notest Devel::Cover::Report::Coveralls
- cpanm --quiet --notest --installdeps --with-develop .

script:
perl Build.PL && ./Build build && cover -test -report coveralls
- PERL5OPT=-MDevel::Cover='-coverage,statement,branch,condition,path,subroutine,+ignore,bin/prove\b,t/author' prove -lrsv t
- cover

after_success:
- cover -report coveralls
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@
Revision history for Mojolicious-Plugin-Form.

{{$NEXT}}
- improve tests

0.007 2015-04-28 17:00:16 CEST
- improve coverage
Expand Down
6 changes: 3 additions & 3 deletions LICENSE
@@ -1,4 +1,4 @@
This software is copyright (c) 2013-2014 by Helmut Wollmersdorfer, <helmut.wollmersdorfer@gmail.com>.
This software is copyright (c) 2013-2015 by Helmut Wollmersdorfer, <helmut.wollmersdorfer@gmail.com>.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
Expand All @@ -12,7 +12,7 @@ b) the "Artistic License"

--- The GNU General Public License, Version 1, February 1989 ---

This software is Copyright (c) 2013-2014 by Helmut Wollmersdorfer, <helmut.wollmersdorfer@gmail.com>.
This software is Copyright (c) 2013-2015 by Helmut Wollmersdorfer, <helmut.wollmersdorfer@gmail.com>.

This is free software, licensed under:

Expand Down Expand Up @@ -272,7 +272,7 @@ That's all there is to it!

--- The Artistic License 1.0 ---

This software is Copyright (c) 2013-2014 by Helmut Wollmersdorfer, <helmut.wollmersdorfer@gmail.com>.
This software is Copyright (c) 2013-2015 by Helmut Wollmersdorfer, <helmut.wollmersdorfer@gmail.com>.

This is free software, licensed under:

Expand Down
2 changes: 1 addition & 1 deletion META.json
Expand Up @@ -48,7 +48,7 @@
}
}
},
"release_status" : "testing",
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"web" : "https://github.com/wollmers/Mojolicious-Plugin-Form/issues"
Expand Down
4 changes: 1 addition & 3 deletions README.md
Expand Up @@ -3,7 +3,6 @@
Mojolicious::Plugin::Form - abstract forms for Mojolicious and DBIx::Class

<div>

<a href="https://travis-ci.org/wollmers/Mojolicious-Plugin-Form"><img src="https://travis-ci.org/wollmers/Mojolicious-Plugin-Form.png" alt="Mojolicious-Plugin-Form"></a>
<a href='https://coveralls.io/r/wollmers/Mojolicious-Plugin-Form?branch=master'><img src='https://coveralls.io/repos/wollmers/Mojolicious-Plugin-Form/badge.png?branch=master' alt='Coverage Status' /></a>
<a href='http://cpants.cpanauthors.org/dist/Mojolicious-Plugin-Form'><img src='http://cpants.cpanauthors.org/dist/Mojolicious-Plugin-Form.png' alt='Kwalitee Score' /></a>
Expand Down Expand Up @@ -31,13 +30,12 @@ Mojolicious::Plugin::Form - abstract forms for Mojolicious and DBIx::Class
Helmut Wollmersdorfer, <helmut.wollmersdorfer@gmail.com>

<div>

<a href='http://cpants.cpanauthors.org/author/wollmers'><img src='http://cpants.cpanauthors.org/author/wollmers.png' alt='Kwalitee Score' /></a>
</div>

# COPYRIGHT AND LICENSE

Copyright (C) 2013-2014 by Helmut Wollmersdorfer
Copyright (C) 2013-2015 by Helmut Wollmersdorfer

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
11 changes: 8 additions & 3 deletions lib/Mojolicious/Plugin/Form.pm
Expand Up @@ -48,12 +48,14 @@ __END__
Mojolicious::Plugin::Form - abstract forms for Mojolicious and DBIx::Class
=for html
=begin html
<a href="https://travis-ci.org/wollmers/Mojolicious-Plugin-Form"><img src="https://travis-ci.org/wollmers/Mojolicious-Plugin-Form.png" alt="Mojolicious-Plugin-Form"></a>
<a href='https://coveralls.io/r/wollmers/Mojolicious-Plugin-Form?branch=master'><img src='https://coveralls.io/repos/wollmers/Mojolicious-Plugin-Form/badge.png?branch=master' alt='Coverage Status' /></a>
<a href='http://cpants.cpanauthors.org/dist/Mojolicious-Plugin-Form'><img src='http://cpants.cpanauthors.org/dist/Mojolicious-Plugin-Form.png' alt='Kwalitee Score' /></a>
<a href="http://badge.fury.io/pl/Mojolicious-Plugin-Form"><img src="https://badge.fury.io/pl/Mojolicious-Plugin-Form.svg" alt="CPAN version" height="18"></a>
=end html
=head1 SYNOPSIS
Expand Down Expand Up @@ -83,12 +85,15 @@ L<http://github.com/wollmers/Mojolicious-Plugin-Form>
Helmut Wollmersdorfer, E<lt>helmut.wollmersdorfer@gmail.comE<gt>
=for html
=begin html
<a href='http://cpants.cpanauthors.org/author/wollmers'><img src='http://cpants.cpanauthors.org/author/wollmers.png' alt='Kwalitee Score' /></a>
=end html
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2013-2014 by Helmut Wollmersdorfer
Copyright (C) 2013-2015 by Helmut Wollmersdorfer
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Expand Down
19 changes: 19 additions & 0 deletions t/author-pod-spelling-mistakes.t
@@ -0,0 +1,19 @@
#!perl

BEGIN {
unless ($ENV{AUTHOR_TESTING}) {
require Test::More;
Test::More::plan(skip_all => 'these tests are for author testing');
}
}

use Test::More;

eval "use Test::Pod::Spelling::CommonMistakes";
if ( $@ ) {
plan skip_all => 'Test::Pod::Spelling::CommonMistakes required for testing POD';
}
else {
all_pod_files_ok();
}

28 changes: 28 additions & 0 deletions t/author-pod-spelling.t
@@ -0,0 +1,28 @@
#!perl

BEGIN {
unless ($ENV{AUTHOR_TESTING}) {
require Test::More;
Test::More::plan(skip_all => 'these tests are for author testing');
}
}

use Test::More;

eval "use Test::Spelling";
if ( $@ ) {
plan skip_all => 'Test::Spelling required for testing POD';
}
else {
add_stopwords(qw(
AproJo
Helmut
Mojolicious
Wollmersdorfer
jQuery
websockets
));
all_pod_files_spelling_ok();
}


36 changes: 15 additions & 21 deletions t/lib/MyApp.pm
Expand Up @@ -43,32 +43,26 @@ sub class {
return $self->entries->{$source};
};

package MySchema::Class {
use Mojo::Base -base;
package MySchema::Class;
use Mojo::Base -base;

has 'table';
1;
}
has 'table';

package MyApp::Form {
use Mojo::Base 'Mojolicious::Plugin::Form::Base';
1;
}

package MyApp::Form::Foo {
use Mojo::Base 'MyApp::Form';
1;
}
package MyApp::Form;
use Mojo::Base 'Mojolicious::Plugin::Form::Base';

package MyApp::Form::Bar {
use Mojo::Base 'MyApp::Form';
1;
}

package MyApp::Form::Defect {
use Mojo::Base 'MyApp::Form';
package MyApp::Form::Foo;
use Mojo::Base 'MyApp::Form';


package MyApp::Form::Bar;
use Mojo::Base 'MyApp::Form';


package MyApp::Form::Defect;
use Mojo::Base 'MyApp::Form';

0; # TODO
}

1;

0 comments on commit e8582c3

Please sign in to comment.