Fix SQLite producer create_view so it doesn't generate statements with semicolons.
[dbsrgits/SQL-Translator.git] / t / 56-sqlite-producer.t
index 4e2a969..945a8bd 100644 (file)
@@ -18,19 +18,19 @@ use SQL::Translator::Producer::SQLite;
                                                     if_not_exists => 1,
                                                   });
   my $create_opts = { no_comments => 1 };
-  my $view1_sql1 = SQL::Translator::Producer::SQLite::create_view($view1, $create_opts);
+  my $view1_sql1 = [ SQL::Translator::Producer::SQLite::create_view($view1, $create_opts) ];
 
-  my $view_sql_replace = "CREATE TEMPORARY VIEW IF NOT EXISTS view_foo AS
-    SELECT id, name FROM thing";
-  is($view1_sql1, $view_sql_replace, 'correct "CREATE TEMPORARY VIEW" SQL');
+  my $view_sql_replace = [ "CREATE TEMPORARY VIEW IF NOT EXISTS view_foo AS
+    SELECT id, name FROM thing" ];
+  is_deeply($view1_sql1, $view_sql_replace, 'correct "CREATE TEMPORARY VIEW" SQL');
 
 
   my $view2 = SQL::Translator::Schema::View->new( name => 'view_foo',
                                                   fields => [qw/id name/],
                                                   sql => 'SELECT id, name FROM thing',);
 
-  my $view1_sql2 = SQL::Translator::Producer::SQLite::create_view($view2, $create_opts);
-  my $view_sql_noreplace = "CREATE VIEW view_foo AS
-    SELECT id, name FROM thing";
-  is($view1_sql2, $view_sql_noreplace, 'correct "CREATE VIEW" SQL');
+  my $view1_sql2 = [ SQL::Translator::Producer::SQLite::create_view($view2, $create_opts) ];
+  my $view_sql_noreplace = [ "CREATE VIEW view_foo AS
+    SELECT id, name FROM thing" ];
+  is_deeply($view1_sql2, $view_sql_noreplace, 'correct "CREATE VIEW" SQL');
 }