(travis) Test::Strict needs Devel::Cover which fails on blead
[dbsrgits/DBIx-Class.git] / examples / Schema / testdb.pl
index 2a1061a..0149bc2 100755 (executable)
@@ -4,9 +4,9 @@ use warnings;
 use strict;
 
 use MyApp::Schema;
+use DBIx::Class::_Util 'parent_dir';
 
-use Path::Class 'file';
-my $db_fn = file($INC{'MyApp/Schema.pm'})->dir->parent->file('db/example.db');
+my $db_fn = parent_dir( $INC{'MyApp/Schema.pm'} ) . '../db/example.db';
 
 # for other DSNs, e.g. MySql, see the perldoc for the relevant dbd
 # driver, e.g perldoc L<DBD::mysql>.
@@ -53,7 +53,8 @@ sub get_tracks_by_artist {
         }
     );
     while (my $track = $rs->next) {
-        print $track->title . "\n";
+        print $track->title . " (from the CD '" . $track->cd->title
+          . "')\n";
     }
     print "\n";
 }
@@ -70,7 +71,7 @@ sub get_cd_by_track {
         }
     );
     my $cd = $rs->first;
-    print $cd->title . "\n\n";
+    print $cd->title . " has the track '$tracktitle'.\n\n";
 }
 
 sub get_cds_by_artist {
@@ -104,7 +105,7 @@ sub get_artist_by_track {
         }
     );
     my $artist = $rs->first;
-    print $artist->name . "\n\n";
+    print $artist->name . " recorded the track '$tracktitle'.\n\n";
 }
 
 sub get_artist_by_cd {
@@ -119,5 +120,5 @@ sub get_artist_by_cd {
         }
     );
     my $artist = $rs->first;
-    print $artist->name . "\n\n";
+    print $artist->name . " recorded the CD '$cdtitle'.\n\n";
 }