more refactoring
authorJason Etheridge <jason@esilibrary.com>
Thu, 25 Jul 2013 15:44:47 +0000 (11:44 -0400)
committerJason Etheridge <jason@esilibrary.com>
Thu, 25 Jul 2013 15:44:47 +0000 (11:44 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/src/sql/Pg/make-pgtap-tests.pl

index 76bc1e5..cd929fb 100755 (executable)
@@ -39,29 +39,24 @@ print pgtap_sql_header();
 handle_schemas(
     sub {
         my $schema = shift;
+
+        sub handle_table_things {
+            my $schema = shift;
+            my $table_or_view = shift;
+            handle_columns(
+                $schema,
+                $table_or_view,
+                undef
+            );
+        }
+
         handle_tables(
             $schema,
-            sub {
-                my $schema = shift;
-                my $table = shift;
-                handle_columns(
-                    $schema,
-                    $table,
-                    undef
-                );
-            }
+            \&handle_table_things
         );
         handle_views(
             $schema,
-            sub {
-                my $schema = shift;
-                my $view = shift;
-                handle_columns(
-                    $schema,
-                    $view,
-                    undef
-                );
-            }
+            \&handle_table_things
         );
 
     }