force-load Moo::HandleMoose::_TypeMap
[scpubgit/Object-Remote.git] / t / lib / ORTestGlobs.pm
CommitLineData
ed5a8a8e 1package ORTestGlobs;
2use Moo;
3
4has handle => (is => 'rw');
5has valueref => (is => 'ro', default => sub {
6 my $body = '';
7 return \$body;
8});
9
10sub write { my $self = shift; print { $self->handle } @_ }
11
12sub getvalue { ${ $_[0]->valueref } }
13
14sub gethandle {
15 open my $fh, '>', $_[0]->valueref
16 or die "Unable to open in-memory file: $!\n";
17 return $fh;
18}
19
20sub getreadhandle {
21 open my $fh, '<', $_[1]
22 or die "Unable to open in-memory file: $!\n";
23 return $fh;
24}
25
261;