summary refs log tree commit diff
path: root/xt
diff options
context:
space:
mode:
Diffstat (limited to 'xt')
-rw-r--r--xt/02_perlcritic.t8
-rw-r--r--xt/03_pod.t4
-rw-r--r--xt/perlcriticrc2
-rw-r--r--xt/run.t4
-rw-r--r--xt/tests/Test/MooseX/UserAgent.pm25
5 files changed, 43 insertions, 0 deletions
diff --git a/xt/02_perlcritic.t b/xt/02_perlcritic.t
new file mode 100644
index 0000000..b977df8
--- /dev/null
+++ b/xt/02_perlcritic.t
@@ -0,0 +1,8 @@
+use strict;
+use Test::More;
+eval {
+    require Test::Perl::Critic;
+    Test::Perl::Critic->import( -profile => 'xt/perlcriticrc');
+};
+plan skip_all => "Test::Perl::Critic is not installed." if $@;
+all_critic_ok('lib');
diff --git a/xt/03_pod.t b/xt/03_pod.t
new file mode 100644
index 0000000..437887a
--- /dev/null
+++ b/xt/03_pod.t
@@ -0,0 +1,4 @@
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok();
diff --git a/xt/perlcriticrc b/xt/perlcriticrc
new file mode 100644
index 0000000..fa96144
--- /dev/null
+++ b/xt/perlcriticrc
@@ -0,0 +1,2 @@
+[TestingAndDebugging::ProhibitNoStrict]
+allow=refs
diff --git a/xt/run.t b/xt/run.t
new file mode 100644
index 0000000..4f0e596
--- /dev/null
+++ b/xt/run.t
@@ -0,0 +1,4 @@
+use lib 'xt/tests';
+use Test::MooseX::UserAgent;
+
+Test::Class->runtests;
diff --git a/xt/tests/Test/MooseX/UserAgent.pm b/xt/tests/Test/MooseX/UserAgent.pm
new file mode 100644
index 0000000..2e04065
--- /dev/null
+++ b/xt/tests/Test/MooseX/UserAgent.pm
@@ -0,0 +1,25 @@
+package Test::MooseX::UserAgent;
+
+use strict;
+use warnings;
+use base 'Test::Class';
+use Test::Exception;
+use Test::More;
+
+sub class { 'MooseX::UserAgent' }
+
+sub startup : Tests(startup => 1) {
+    my $test = shift;
+    use_ok $test->class, "use ok";
+}
+
+sub shutdown : Tests(shutdown) {
+    my $test = shift;
+}
+
+sub constructor : Tests(1) {
+    my $test = shift;
+    can_ok $test->class, 'new';
+}
+
+1;