From: Justin Hunter Date: Wed, 27 Jan 2010 05:13:23 +0000 (-0800) Subject: update test X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d4cc9bbd0ba7d9a318899a3a22f42d744d687e05;p=dbsrgits%2FSQL-Translator-2.0-ish.git update test --- diff --git a/t/61translator_agnostic.t b/t/61translator_agnostic.t index e706717..d9bebcf 100644 --- a/t/61translator_agnostic.t +++ b/t/61translator_agnostic.t @@ -3,37 +3,31 @@ use warnings; use strict; use Test::More; -use Test::SQL::Translator; use FindBin qw/$Bin/; - -BEGIN { - maybe_plan(1, 'SQL::Translator::Parser::XML', - 'SQL::Translator::Producer::XML'); -} - use SQL::Translator; # Producing a schema with a Translator different from the one the schema was # generated should just work. After all the $schema object is just data. - my $base_file = "$Bin/data/xml/schema.xml"; my $base_t = SQL::Translator->new; -$base_t->$_ (1) for qw/add_drop_table no_comments/; +$base_t->$_(1) for qw/add_drop_table no_comments/; # create a base schema attached to $base_t -my $base_schema = $base_t->translate ( +open (my $base_fh, '<', $base_file) or die "$base_file: $!"; + +my $base_schema = $base_t->translate( parser => 'XML', - file => $base_file, -) or die $base_t->error; + data => do { local $/; <$base_fh>; }, +) or die $!; # now create a new translator and try to feed it the same schema my $new_t = SQL::Translator->new; -$new_t->$_ (1) for qw/add_drop_table no_comments/; +$new_t->$_(1) for qw/add_drop_table no_comments/; -my $sql = $new_t->translate ( - data => $base_schema, +my $sql = $new_t->translate( producer => 'SQLite' + data => $base_schema, ); TODO: { @@ -45,3 +39,5 @@ TODO: { "Received some meaningful output from the producer", ); } + +done_testing;