diff --git a/lib/WebGUI/Asset/Wobject/Survey/Test.pm b/lib/WebGUI/Asset/Wobject/Survey/Test.pm index f2d4fe5f2..631494d78 100644 --- a/lib/WebGUI/Asset/Wobject/Survey/Test.pm +++ b/lib/WebGUI/Asset/Wobject/Survey/Test.pm @@ -1,6 +1,7 @@ package WebGUI::Asset::Wobject::Survey::Test; use strict; +use Test::Deep::NoTest qw/eq_deeply/; use Moose; use WebGUI::Definition::Crud; extends qw/WebGUI::Crud/; @@ -43,7 +44,6 @@ END_SPEC use WebGUI::International; -use Test::Deep::NoTest; use JSON::PP; use Data::Dumper; use Params::Validate qw(:all); diff --git a/t/Asset/Wobject/Survey/Test.t b/t/Asset/Wobject/Survey/Test.t index 20ecd4ca3..6e3b5415d 100644 --- a/t/Asset/Wobject/Survey/Test.t +++ b/t/Asset/Wobject/Survey/Test.t @@ -19,7 +19,6 @@ my $session = WebGUI::Test->session; #---------------------------------------------------------------------------- # Tests -plan tests => 94; my $tp = use_ok('TAP::Parser'); my $tpa = use_ok('TAP::Parser::Aggregator'); @@ -156,6 +155,25 @@ my $t1 = WebGUI::Asset::Wobject::Survey::Test->new( $session, { assetId => $s->g WebGUI::Test->addToCleanup(sub {$t1->delete();}); my $spec; +can_ok($t1, qw/assetId name test lastUpdated testId session dateCreated sequenceNumber update set get/); +$t1->name('test name'); +is $t1->name, 'test name', 'name: direct mutator works okay'; +$t1->test('some test'); +is $t1->test, 'some test', 'test: mutator check'; +$t1->set({ name => 'tested name' }); +is $t1->name, 'tested name', 'name: set works okay'; +$t1->set({test => 'tested some'}); +is $t1->test, 'tested some', 'test: set'; +$t1->update({ name => 'different name' }); +is $t1->name, 'different name', 'update: updated name'; +$t1->update({ test => 'another test', name => 'another name', }); +is $t1->name, 'another name', 'update: name, test and name together'; +is $t1->test, 'another test', 'update: test'; + +my $name_prop = $t1->meta->find_attribute_by_name('name'); +ok $name_prop->does('WebGUI::Definition::Meta::Property'), '::Test property does Meta::Property'; +ok $name_prop->does('WebGUI::Definition::Meta::Settable'), '::Test property does Meta::Settable'; + # No tests $spec = <update( { test => $spec } ); $test->test($spec); my $result = $t1->run(); ok( $result, 'Tests ran ok' ); @@ -725,4 +742,6 @@ Hashes differ on element: a expect : '2' END_CMP +done_testing; + #vim:ft=perl