From: Peter Rabbitson Date: Tue, 22 Feb 2011 12:52:58 +0000 (+0100) Subject: Move the test bits related to deprecated IC::File out of the main testschema X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=123df5269e2a19f93ff072bbf92832fb23d19f4c;p=dbsrgits%2FDBIx-Class-Historic.git Move the test bits related to deprecated IC::File out of the main testschema --- diff --git a/t/inflate/file_column.t b/t/inflate/file_column.t index b8330bf..24407e2 100644 --- a/t/inflate/file_column.t +++ b/t/inflate/file_column.t @@ -4,18 +4,40 @@ use warnings; use Test::More; use lib qw(t/lib); -# inject IC::File into the result baseclass for testing -BEGIN { - $ENV{DBIC_IC_FILE_NOWARN} = 1; - require DBICTest::BaseResult; - DBICTest::BaseResult->load_components (qw/InflateColumn::File/); -} - use DBICTest; +use DBICTest::Schema; use File::Compare; use Path::Class qw/file/; +{ + local $ENV{DBIC_IC_FILE_NOWARN} = 1; + + package DBICTest::Schema::FileColumn; + + use strict; + use warnings; + use base qw/DBICTest::BaseResult/; + + use File::Temp qw/tempdir/; + + __PACKAGE__->load_components (qw/InflateColumn::File/); + __PACKAGE__->table('file_columns'); + + __PACKAGE__->add_columns( + id => { data_type => 'integer', is_auto_increment => 1 }, + file => { + data_type => 'varchar', + is_file_column => 1, + file_column_path => tempdir(CLEANUP => 1), + size => 255 + } + ); + + __PACKAGE__->set_primary_key('id'); +} +DBICTest::Schema->load_classes('FileColumn'); + my $schema = DBICTest->init_schema; plan tests => 10; diff --git a/t/lib/DBICTest/Schema.pm b/t/lib/DBICTest/Schema.pm index e47b2f9..07b311a 100644 --- a/t/lib/DBICTest/Schema.pm +++ b/t/lib/DBICTest/Schema.pm @@ -11,7 +11,6 @@ __PACKAGE__->load_classes(qw/ BindType Employee CD - FileColumn Genre Bookmark Link diff --git a/t/lib/DBICTest/Schema/FileColumn.pm b/t/lib/DBICTest/Schema/FileColumn.pm deleted file mode 100644 index 046e7c2..0000000 --- a/t/lib/DBICTest/Schema/FileColumn.pm +++ /dev/null @@ -1,23 +0,0 @@ -package -DBICTest::Schema::FileColumn; - -use strict; -use warnings; -use base qw/DBICTest::BaseResult/; -use File::Temp qw/tempdir/; - -__PACKAGE__->table('file_columns'); - -__PACKAGE__->add_columns( - id => { data_type => 'integer', is_auto_increment => 1 }, - file => { - data_type => 'varchar', - is_file_column => 1, - file_column_path => tempdir(CLEANUP => 1), - size => 255 - } -); - -__PACKAGE__->set_primary_key('id'); - -1; diff --git a/t/lib/sqlite.sql b/t/lib/sqlite.sql index b14bd5e..ff9597f 100644 --- a/t/lib/sqlite.sql +++ b/t/lib/sqlite.sql @@ -1,6 +1,6 @@ -- -- Created by SQL::Translator::Producer::SQLite --- Created on Mon Feb 21 12:10:04 2011 +-- Created on Tue Feb 22 18:42:16 2011 -- -- @@ -60,14 +60,6 @@ CREATE TABLE event ( ); -- --- Table: file_columns --- -CREATE TABLE file_columns ( - id INTEGER PRIMARY KEY NOT NULL, - file varchar(255) NOT NULL -); - --- -- Table: fourkeys -- CREATE TABLE fourkeys (