# Copyright (c) 2006 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: MailPartList.bunit,v 1.4 2008/01/30 18:07:57 nagler Exp $ ListModel(); req()->initialize_fully; [ { method => 'load_from_content', check_return => sub { my($case, $actual, $expect) = @_; my($o) = $case->get('object'); $case->actual_return([ map({ $o->set_cursor_or_not_found($_->{index}); foreach my $k (grep(s/^\-\>//, keys(%$_))) { my($m, @a) = split(' ', $k); $_->{"->$k"} = $o->$m(@a);; } $_->{mime_entity} = $_->{mime_entity}->bodyhandle && $_->{mime_entity}->bodyhandle->as_string if exists($_->{mime_entity}); $_; } @$actual), ]); return $expect; }, } => [ map(( [read_file($_)] => do(($_ =~ /(.*)in$/)[0] . 'out') || die($@), ), glob('MailPartList/*.in')), ], load_from_content => [ [read_file('MailPartList/mime_cid')] => not_die(), ], unsafe_get_cursor_for_mime_cid => [ 'pqwflo4g7tvg3mo9.9w2xcpn7sss75wi4@bivio.biz' => 2, 'notfound' => [undef], ], ];