Only import what we're going to use from Test::Deep::NoTest.
This commit is contained in:
parent
52337ee0d6
commit
e6f7f218f2
2 changed files with 22 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package WebGUI::Asset::Wobject::Survey::Test;
|
package WebGUI::Asset::Wobject::Survey::Test;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
use Test::Deep::NoTest qw/eq_deeply/;
|
||||||
use Moose;
|
use Moose;
|
||||||
use WebGUI::Definition::Crud;
|
use WebGUI::Definition::Crud;
|
||||||
extends qw/WebGUI::Crud/;
|
extends qw/WebGUI::Crud/;
|
||||||
|
|
@ -43,7 +44,6 @@ END_SPEC
|
||||||
|
|
||||||
|
|
||||||
use WebGUI::International;
|
use WebGUI::International;
|
||||||
use Test::Deep::NoTest;
|
|
||||||
use JSON::PP;
|
use JSON::PP;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
use Params::Validate qw(:all);
|
use Params::Validate qw(:all);
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Tests
|
# Tests
|
||||||
plan tests => 94;
|
|
||||||
|
|
||||||
my $tp = use_ok('TAP::Parser');
|
my $tp = use_ok('TAP::Parser');
|
||||||
my $tpa = use_ok('TAP::Parser::Aggregator');
|
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();});
|
WebGUI::Test->addToCleanup(sub {$t1->delete();});
|
||||||
my $spec;
|
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
|
# No tests
|
||||||
$spec = <<END_SPEC;
|
$spec = <<END_SPEC;
|
||||||
[ ]
|
[ ]
|
||||||
|
|
@ -686,7 +704,6 @@ sub try_it {
|
||||||
my ( $test, $spec, $opts ) = @_;
|
my ( $test, $spec, $opts ) = @_;
|
||||||
chomp($spec);
|
chomp($spec);
|
||||||
|
|
||||||
$test->update( { test => $spec } );
|
|
||||||
$test->test($spec);
|
$test->test($spec);
|
||||||
my $result = $t1->run();
|
my $result = $t1->run();
|
||||||
ok( $result, 'Tests ran ok' );
|
ok( $result, 'Tests ran ok' );
|
||||||
|
|
@ -725,4 +742,6 @@ Hashes differ on element: a
|
||||||
expect : '2'
|
expect : '2'
|
||||||
END_CMP
|
END_CMP
|
||||||
|
|
||||||
|
done_testing;
|
||||||
|
|
||||||
#vim:ft=perl
|
#vim:ft=perl
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue