Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new release, ver 7.84 with inheritance support
- Loading branch information
Al Newkirk
committed
Sep 20, 2012
1 parent
ef5867f
commit 504ff51
Showing
8 changed files
with
102 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use Test::More; | ||
|
||
BEGIN { | ||
use FindBin; | ||
use lib $FindBin::Bin . "/myapp/lib"; | ||
} | ||
|
||
package main; | ||
|
||
use MyApp::Container; | ||
|
||
my $v = MyApp::Container->new; | ||
|
||
ok $v, 'new obj'; | ||
ok $v->proto->fields->{id}, 'obj has an id field'; | ||
ok $v->proto->fields->{name}, 'obj has a name field'; | ||
ok $v->proto->fields->{email}, 'obj has an email field'; | ||
ok $v->proto->mixins->{basic}, 'obj has a basic mixin'; | ||
ok $v->proto->mixins->{other}, 'obj has an other mixin'; | ||
ok $v->proto->mixins->{email}, 'obj has an email mixin'; | ||
|
||
ok 1 == $v->id, "obj's id field was set and is ok"; | ||
ok 'Boy' eq $v->name, "obj's name field was set and is ok"; | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package MyApp::Container; | ||
|
||
use base 'MyApp::Test::Base'; | ||
|
||
use Validation::Class; | ||
|
||
mxn other => { | ||
required => 1, | ||
max_length => 255, | ||
filters => [qw/trim strip/] | ||
}; | ||
|
||
fld name => { | ||
mixin => 'basic', | ||
max_length => 255, | ||
required => 0 | ||
}; | ||
|
||
bld sub { | ||
|
||
my ($self) = @_; | ||
|
||
$self->name('Boy'); | ||
|
||
return $self; | ||
|
||
}; | ||
|
||
1; |