From: Justin Hunter Date: Tue, 9 Feb 2010 06:24:09 +0000 (-0800) Subject: make this test pass, fix it up to match new SQLT design X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b0f5a88b5f6ca85b9e719372f82c47d385c0a611;p=dbsrgits%2FSQL-Translator-2.0-ish.git make this test pass, fix it up to match new SQLT design --- diff --git a/t/56-sqlite-producer.t b/t/56-sqlite-producer.t index 2bf3881..25d43cc 100644 --- a/t/56-sqlite-producer.t +++ b/t/56-sqlite-producer.t @@ -1,11 +1,14 @@ use strict; +use warnings; use Test::More; -use FindBin qw/$Bin/; +use SQL::Translator; use SQL::Translator::Object::View; -use SQL::Translator::Producer::SQL::SQLite; { + my $sqlt = SQL::Translator->new( to => 'SQLite' ); + my $producer = $sqlt->_producer; + my $view1 = SQL::Translator::Object::View->new( name => 'view_foo', fields => [qw/id name/], sql => 'SELECT id, name FROM thing', @@ -13,19 +16,19 @@ use SQL::Translator::Producer::SQL::SQLite; temporary => 1, if_not_exists => 1, }); + my $create_opts = { no_comments => 1 }; - my $view1_sql1 = SQL::Translator::Producer::SQL::SQLite::create_view($view1, $create_opts); + my $view1_sql1 = $producer->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 $view2 = SQL::Translator::Object::View->new( name => 'view_foo', fields => [qw/id name/], sql => 'SELECT id, name FROM thing',); - my $view1_sql2 = SQL::Translator::Producer::SQL::SQLite::create_view($view2, $create_opts); + my $view1_sql2 = $producer->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');