From 006bda8dd076db211101796872f036c53ad97ed7 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 4 Mar 2010 16:07:48 -0800 Subject: [PATCH] More Test::Class tests for AssetBase.pm --- t/tests/Test/AssetBase.pm | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/t/tests/Test/AssetBase.pm b/t/tests/Test/AssetBase.pm index da69c9822..61afc719b 100644 --- a/t/tests/Test/AssetBase.pm +++ b/t/tests/Test/AssetBase.pm @@ -32,6 +32,10 @@ sub assetUiLevel { return 1; } +sub list_of_tables { + return [qw/assetData/]; +} + sub _00_init : Test(startup) { my $test = shift; my $session = WebGUI::Test->session; @@ -39,7 +43,7 @@ sub _00_init : Test(startup) { eval { require $test->class; }; } -sub constructor : Test(4) { +sub _constructor : Test(4) { my $test = shift; my $session = $test->session; my $asset = $test->class->new({session => $session}); @@ -194,10 +198,21 @@ sub keywords : Test(3) { className => $test->class, }); addToCleanup($asset); - can_ok($asset, 'keywords'); + can_ok $asset, 'keywords'; $asset->keywords('chess set'); - is ($asset->keywords, 'chess set', 'set and get of keywords via direct accessor'); - #is ($asset->get('keywords'), 'chess set', 'via get method'); + is $asset->keywords, 'chess set', 'set and get of keywords via direct accessor'; + is $asset->get('keywords'), 'chess set', 'via get method'; +} + +sub keywords : Test(1) { + my $test = shift; + note "get_tables"; + my @tables = $test->class->meta->get_tables; + cmp_deeply( + \@tables, + $test->list_of_tables, + 'Set of tables for properties is correct' + ); } 1;