Merge branch 'patch-1' of https://github.com/dsteinbrunner/sql-translator
[dbsrgits/SQL-Translator.git] / lib / Test / SQL / Translator.pm
index d969464..6caef98 100644 (file)
@@ -14,9 +14,9 @@ use Test::More;
 use SQL::Translator::Schema::Constants;
 
 use base qw(Exporter);
-use vars qw($VERSION @EXPORT @EXPORT_OK);
-$VERSION = '1.59';
-@EXPORT = qw(
+our @EXPORT_OK;
+our $VERSION = '1.59';
+our @EXPORT = qw(
     schema_ok
     table_ok
     field_ok
@@ -124,13 +124,13 @@ sub default_attribs {
     my ($hashref, $object_type) = @_;
 
     if ( !exists $ATTRIBUTES{ $object_type } ) {
-        die "Can't add default attribs for unknown Schema " 
+        die "Can't add default attribs for unknown Schema "
         .   "object type '$object_type'.";
     }
 
-    for my $attr ( 
+    for my $attr (
         grep { !exists $hashref->{ $_ } }
-        keys %{ $ATTRIBUTES{ $object_type } } 
+        keys %{ $ATTRIBUTES{ $object_type } }
     ) {
         $hashref->{ $attr } = $ATTRIBUTES{ $object_type }{ $attr }
     }
@@ -236,7 +236,7 @@ sub constraint_ok {
 
     is_deeply( [$obj->options], $test->{options},
     "$t_name    options are '".join(",",@{$test->{options}})."'" );
-    
+
     is_deeply( { $obj->extra }, $test->{extra}, "$t_name    extra" );
 }
 
@@ -257,7 +257,7 @@ sub index_ok {
 
     is_deeply( [$obj->options], $test->{options},
     "$t_name    options are '".join(",",@{$test->{options}})."'" );
-    
+
     is_deeply( { $obj->extra }, $test->{extra}, "$t_name    extra" );
 }
 
@@ -285,7 +285,7 @@ sub trigger_ok {
         "$t_name    on_table is '$test->{on_table}'" );
 
     is( $obj->action, $test->{action}, "$t_name    action is '$test->{action}'" );
-    
+
     is_deeply( { $obj->extra }, $test->{extra}, "$t_name    extra" );
 }
 
@@ -305,7 +305,7 @@ sub view_ok {
 
     is_deeply( [$obj->fields], $test->{fields},
     "$t_name    fields are '".join(",",@{$test->{fields}})."'" );
-    
+
     is_deeply( { $obj->extra }, $test->{extra}, "$t_name    extra" );
 }
 
@@ -323,11 +323,11 @@ sub procedure_ok {
     is_deeply( [$obj->parameters], $test->{parameters},
     "$t_name    parameters are '".join(",",@{$test->{parameters}})."'" );
 
-    is( $obj->comments, $test->{comments}, 
+    is( $obj->comments, $test->{comments},
         "$t_name    comments is '$test->{comments}'" );
 
     is( $obj->owner, $test->{owner}, "$t_name    owner is '$test->{owner}'" );
-   
+
     is_deeply( { $obj->extra }, $test->{extra}, "$t_name    extra" );
 }
 
@@ -348,7 +348,7 @@ sub table_ok {
     # Fields
     if ( $arg{fields} ) {
         my @fldnames = map {$_->{name}} @{$arg{fields}};
-        is_deeply( 
+        is_deeply(
             [ map {$_->name}   $obj->get_fields ],
             [ @fldnames ],
             "${t_name}    field names are ".join(", ",@fldnames)
@@ -384,7 +384,7 @@ sub _test_kids {
             my $meth = "get_$plural";
             my @objects  = $obj->$meth;
             is( scalar(@objects), scalar(@tests),
-                "${t_name}$obj_name has " . scalar(@tests) . " $plural" 
+                "${t_name}$obj_name has " . scalar(@tests) . " $plural"
             );
 
             for my $object (@objects) {
@@ -409,7 +409,7 @@ sub schema_ok {
 
     is( $obj->database, $test->{database},
         "$t_name    database is '$test->{database}'" );
-    
+
     is_deeply( { $obj->extra }, $test->{extra}, "$t_name    extra" );
 
     is( $obj->is_valid, $test->{is_valid},
@@ -600,7 +600,7 @@ does field_ok run? Can then use these to set up the test plan easily.
 
 =item Test skipping
 
-As the test subs wrap up lots of tests in one call you can't skip idividual
+As the test subs wrap up lots of tests in one call you can't skip individual
 tests only whole sets e.g. a whole table or field.
 We could add skip_* items to the test hashes to allow per test skips. e.g.
 
@@ -618,7 +618,7 @@ schema file and test yaml file to compare it against.
 
 =head1 AUTHOR
 
-Mark D. Addison E<lt>mark.addison@itn.co.ukE<gt>, 
+Mark D. Addison E<lt>mark.addison@itn.co.ukE<gt>,
 Darren Chamberlain <darren@cpan.org>.
 
 Thanks to Ken Y. Clark for the original table and field test code taken from