BEGIN {
eval "use IO::String; use IO::File;";
plan skip_all => "IO::String and IO::File are required for this test" if $@;
- plan tests => 29;
+ plan tests => 28;
}
-BEGIN {
- use_ok('Moose');
-}
+
{
package Email::Moose;
=> from 'FileHandle'
=> via { bless $_, 'IO::File' };
+ # create the alias
+
+ subtype 'IO::StringOrFile' => as 'IO::String | IO::File';
+
# attributes
has 'raw_body' => (
is => 'rw',
- isa => 'IO::String | IO::File',
+ isa => 'IO::StringOrFile',
coerce => 1,
default => sub { IO::String->new() },
);