From: Peter Rabbitson Date: Tue, 21 Apr 2009 12:48:26 +0000 (+0000) Subject: Fix borked tests X-Git-Tag: 0.03001~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0b7e9d74d5333e340b475f8d32eb2c56f2a616a6;p=dbsrgits%2FDBIx-Class-Tree.git Fix borked tests --- diff --git a/t/10_adjacencylist.t b/t/10_adjacencylist.t index 42b80cf..61fe503 100644 --- a/t/10_adjacencylist.t +++ b/t/10_adjacencylist.t @@ -4,13 +4,19 @@ use warnings; use lib 't/lib'; use Test::More; -use TreeTest; -TreeTest::Schema::Node->load_components(qw( +BEGIN { # This must happen before the schema is loaded + + require TreeTest::Schema::Node; + + TreeTest::Schema::Node->load_components(qw( Tree::AdjacencyList -)); + )); -TreeTest::Schema::Node->parent_column( 'parent_id' ); + TreeTest::Schema::Node->parent_column( 'parent_id' ); +} + +use TreeTest; my $tests = TreeTest::count_tests(); plan tests => $tests; diff --git a/t/11_adjacencylist_ordered.t b/t/11_adjacencylist_ordered.t index 6c1419e..372c8b4 100644 --- a/t/11_adjacencylist_ordered.t +++ b/t/11_adjacencylist_ordered.t @@ -4,15 +4,20 @@ use warnings; use lib 't/lib'; use Test::More; -use TreeTest; -TreeTest::Schema::Node->load_components(qw( +BEGIN { # This must happen before the schema is loaded + + require TreeTest::Schema::Node; + + TreeTest::Schema::Node->load_components(qw( Tree::AdjacencyList::Ordered -)); + )); -TreeTest::Schema::Node->position_column( 'position' ); -TreeTest::Schema::Node->parent_column( 'parent_id' ); + TreeTest::Schema::Node->position_column( 'position' ); + TreeTest::Schema::Node->parent_column( 'parent_id' ); +} +use TreeTest; my $tests = TreeTest::count_tests(); plan tests => $tests; TreeTest::run_tests();