Resolve a todo to pass pod-coverage-moose
[gitmo/Mouse.git] / xt / 06_usermodules.t
1 #!perl
2
3 use if !$ENV{RELEASE_TESTING}, 'Test::More' => (skip_all => "for release testing");
4
5 use strict;
6 use warnings;
7 use Test::Requires qw(Test::DependentModules);
8 use Test::More;
9
10 use Test::DependentModules qw(test_module);
11
12 use Cwd qw(abs_path);
13
14 note("Testing user modules which depend on Mouse");
15
16 $ENV{PERL_TEST_DM_LOG_DIR} = abs_path('.');
17
18 my @modules = qw(
19     MouseX::Types
20     MouseX::Types::Path::Class
21
22     MouseX::AttributeHelpers
23     MouseX::Getopt
24     MouseX::ConfigFromFile
25
26     Any::Moose
27
28     HTTP::Engine
29     HTTP::Engine::Middleware
30
31     HTML::Shakan
32     Net::Google::DataAPI
33 );
34
35 test_module($_) for @modules;
36
37 done_testing;
38
39 __END__
40 # TODO
41 BEGIN{
42     $ENV{PERL5OPT}       = '-Mblib' if exists $INC{'blib.pm'};
43     #$ENV{PERL_CPANM_DEV} = 1;
44 }
45
46 use strict;
47 use warnings;
48 use Test::Requires qw(App::cpanminus::script);
49 use Test::More;
50
51 BEGIN{
52     package Test::UserModules;
53     our @ISA = qw(App::cpanminus::script);
54
55     sub init {
56         my($self) = @_;
57         $self->hook('test_user_modules', 'install_success' => \&_install_success);
58         $self->hook('test_user_modules', 'build_failure'   => \&_build_failure);
59         $self->SUPER::init();
60     }
61
62     sub log {
63         my($self, @messages) = @_;
64         #Test::More->builder->note(@messages);
65         return;
66     }
67
68     sub _install_success {
69         my($args) = @_;
70         Test::More->builder->ok(1, "install $args->{module}");
71     }
72
73     sub _build_failure {
74         my($args) = @_;
75         Test::More->builder->ok(0, "install $args->{module} ($args->{message})");
76     }
77 }
78
79 # See also http://cpants.perl.org/dist/used_by/Any-Moose
80
81 my @user_modules = qw(
82     MouseX::Types
83     MouseX::Types::Path::Class
84
85     MouseX::AttributeHelpers
86     MouseX::Getopt
87     MouseX::ConfigFromFile
88
89     Any::Moose
90
91     HTTP::Engine
92     HTTP::Engine::Middleware
93
94     git://github.com/typester/ark-perl.git
95     HTML::Shakan
96     Net::Google::API
97 );
98
99 my $t = Test::UserModules->new();
100 $t->parse_options(@user_modules);
101 $t->doit();
102
103
104 done_testing;