{
my $code = <<'EOF';
-package Test::Class1;
-
-use strict;
-use warnings;
-
use Moose;
sub foo { 42 }
-
-1;
EOF
- save_class( 'Test::Class1', $code );
+ my $class = 'Test::Class1';
+ save_class( $class, $code );
my $compiler = MooseX::Compiler->new(
- class => 'Test::Class1',
+ class => $class,
);
my $compiled = $compiler->compile_class();
{
my $code = <<'EOF';
-package Test::Class2;
-
-use strict;
-use warnings;
-
use Moose 0.1;
sub foo { 42 }
1;
EOF
- save_class( 'Test::Class1', $code );
+ my $class = 'Test::Class2';
+ save_class( $class, $code );
my $compiler = MooseX::Compiler->new(
- class => 'Test::Class1',
+ class => $class,
);
my $compiled = $compiler->compile_class();
{
my $code = <<'EOF';
-package Test::Class3;
-
-use strict;
-use warnings;
-
use Moose;
use MooseX::StrictConstructor;
sub foo { 42 }
-
-1;
EOF
- save_class( 'Test::Class1', $code );
+ my $class = 'Test::Class3';
+ save_class( $class, $code );
my $compiler = MooseX::Compiler->new(
- class => 'Test::Class1',
+ class => $class,
);
my $compiled = $compiler->compile_class();
{
my $code = <<'EOF';
-package Test::Class4;
-
-use strict;
-use warnings;
-
use Moose;
use MooseX::StrictConstructor 0.01;
sub foo { 42 }
-
-1;
EOF
- save_class( 'Test::Class1', $code );
+ my $class = 'Test::Class4';
+ save_class( $class, $code );
my $compiler = MooseX::Compiler->new(
- class => 'Test::Class1',
+ class => $class,
);
my $compiled = $compiler->compile_class();