# Copyright (c) 2009 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: ClassWrapper.bunit,v 1.1 2009/05/01 16:55:33 nagler Exp $ my($one) = 1; [ class() => [ wrap_methods => [ [class('Bivio::t::ClassWrapper::T1') => {a1 => 1}, { one => sub { my($self, $args) = @_; $one += $args->[1]; return $self->call_method($args); }, new_method => sub { my($self, $args) = @_; assert_equals(undef, $self->get('code_ref')); assert_equals(1, $self->get('a1')); return $self->get('method'); }, simple_package_name => sub { my($self, $args) = @_; return 'bunit ' . $self->call_method($args); }, }] => not_die(), ], ], sub {'Bivio::t::ClassWrapper::T1'} => [ one => [ 3 => sub { assert_equals($one, 4); return 1; }, ], new_method => 'new_method', simple_package_name => 'bunit T1', ], ];