comparison Lib/IMPL/Test.pm @ 275:6253872024a4

*refactoring IMPL::Class
author cin
date Thu, 31 Jan 2013 02:18:31 +0400
parents 4d0e1962161c
children 4ddb27ff4a0b
comparison
equal deleted inserted replaced
274:8d36073411b1 275:6253872024a4
25 sub shared($) { 25 sub shared($) {
26 my ($propInfo) = @_; 26 my ($propInfo) = @_;
27 27
28 my $class = caller; 28 my $class = caller;
29 29
30 die new IMPL::Exception("Only properties could be declared as shared",$propInfo->Name) unless eval {$propInfo->isa('IMPL::Class::PropertyInfo')}; 30 die new IMPL::Exception("Only properties could be declared as shared",$propInfo->name) unless eval {$propInfo->isa('IMPL::Class::PropertyInfo')};
31 die new IMPL::Exception("You can't mark the readonly property as shared",$propInfo->Name) unless $propInfo->canSet; 31 die new IMPL::Exception("You can't mark the readonly property as shared",$propInfo->name) unless $propInfo->canSet;
32 die new IMPL::Exception("Only public properties could be declared as shared",$propInfo->Name) unless $propInfo->Access == IMPL::Class::Member::MOD_PUBLIC; 32 die new IMPL::Exception("Only public properties could be declared as shared",$propInfo->name) unless $propInfo->access == IMPL::Class::Member::MOD_PUBLIC;
33 33
34 $class->set_meta(new IMPL::Test::Unit::SharedData($propInfo->Name)); 34 $class->set_meta(new IMPL::Test::Unit::SharedData($propInfo->name));
35 } 35 }
36 36
37 sub failed($;@) { 37 sub failed($;@) {
38 die new IMPL::Test::FailException(@_); 38 die new IMPL::Test::FailException(@_);
39 } 39 }