Przeglądaj źródła

Fix issue with Types::Serialiser needing explicit ref on winows

Also fix some POD issues
George S. Baugh 11 lat temu
rodzic
commit
0cff91d7ea
6 zmienionych plików z 59 dodań i 11 usunięć
  1. 1 0
      Changes
  2. 1 0
      MANIFEST
  3. 5 3
      Makefile.PL
  4. BIN
      dist/TestRail-API-0.008.tar.gz
  5. 36 8
      lib/TestRail/API.pm
  6. 16 0
      t/pod.t

+ 1 - 0
Changes

@@ -1 +1,2 @@
 v0.001-0.007 - More or less the pursuit of Kwalitee
+v0.008 - Explicitly include Types::Serialiser, correct some POD issues

+ 1 - 0
MANIFEST

@@ -5,3 +5,4 @@ Changes
 LICENSE
 lib/TestRail/API.pm
 t/TestRail-API.t
+t/pod.t

+ 5 - 3
Makefile.PL

@@ -18,7 +18,8 @@ WriteMakefile(
         "Try::Tiny"           => 0,
         "JSON::XS"            => 0,
         "HTTP::Request"       => 0,
-        "LWP::UserAgent"      => 0
+        "LWP::UserAgent"      => 0,
+        "Types::Serialiser"   => 0
     },
     META_MERGE => {
         'meta-spec' => { version => 2 },
@@ -44,7 +45,8 @@ WriteMakefile(
                     "Try::Tiny"           => 0,
                     "JSON::XS"            => 0,
                     "HTTP::Request"       => 0,
-                    "LWP::UserAgent"      => 0
+                    "LWP::UserAgent"      => 0,
+                    "Types::Serialiser"   => 0
                 }
             },
             test => {
@@ -58,7 +60,7 @@ WriteMakefile(
         provides => {
             'TestRail::API' => {
                 file    => 'lib/TestRail/API.pm',
-                version => '0.007'
+                version => '0.008'
             }
         }
     }

BIN
dist/TestRail-API-0.008.tar.gz


+ 36 - 8
lib/TestRail/API.pm

@@ -1,6 +1,6 @@
 package TestRail::API;
 {
-    $TestRail::API::VERSION = '0.007';
+    $TestRail::API::VERSION = '0.008';
 }
 
 =head1 NAME
@@ -31,6 +31,7 @@ use Try::Tiny;
 use JSON::XS;
 use HTTP::Request;
 use LWP::UserAgent;
+use Types::Serialiser; #Not necesarily shared by JSON::XS on all platforms
 
 =head1 CONSTRUCTOR
 
@@ -83,6 +84,16 @@ sub new {
     return $self;
 }
 
+=head1 GETTERS
+
+=head2 B<browser>
+=head2 B<apiurl>
+=head2 B<debug>
+
+Accessors for these parameters you pass into the constructor, in case you forget.
+
+=cut
+
 #EZ access of obj vars
 sub browser {$_[0]->{'browser'}}
 sub apiurl {$_[0]->{'apiurl'}}
@@ -229,7 +240,7 @@ sub createProject {
 
 }
 
-=head2 B<deleteProjectByID (id)>
+=head2 B<deleteProject (id)>
 
 Deletes specified project by ID.
 Requires TestRail admin login.
@@ -896,6 +907,28 @@ sub deleteRun {
     return $result;
 }
 
+=head2 B<getRuns (project_id)>
+
+Get all runs for specified project.
+
+=over 4
+
+=item INTEGER C<PROJECT_ID> - ID of parent project
+
+=back
+
+Returns ARRAYREF of run definition HASHREFs.
+
+    $allRuns = $tr->getRuns(6969);
+
+=cut
+
+sub getRuns {
+    my ($self,$project_id) = @_;
+    return $self->_doRequest("index.php?/api/v2/get_runs/$project_id");
+}
+
+
 =head2 B<getRunByName (project_id,name)>
 
 Gets run by name.
@@ -914,11 +947,6 @@ Returns run definition HASHREF.
 
 =cut
 
-sub getRuns {
-    my ($self,$project_id) = @_;
-    return $self->_doRequest("index.php?/api/v2/get_runs/$project_id");
-}
-
 sub getRunByName {
     my ($self,$project_id,$name) = @_;
     my $runs = $self->getRuns($project_id);
@@ -951,7 +979,7 @@ sub getRunByID {
 
 =head1 PLAN METHODS
 
-=head2 B<createRun (project_id,name,description,milestone_id,entries)>
+=head2 B<createPlan (project_id,name,description,milestone_id,entries)>
 
 Create a run.
 

+ 16 - 0
t/pod.t

@@ -0,0 +1,16 @@
+use strict;
+use warnings;
+
+use Test::Pod 'tests' => 2;
+use Test::Pod::Coverage;
+use TestRail::API;
+
+my @pobjfiles = map { $INC{$_} } ('TestRail/API.pm');
+foreach my $pm (@pobjfiles) {
+    pod_file_ok($pm);
+}
+
+my @modules = ('TestRail::API');
+foreach my $mod (@modules) {
+    pod_coverage_ok($mod);
+}