);
my $compiled = $compiler->compile_class();
+
like(
$compiled,
qr/sub new {.+\n}\n/s,
}
}
+{
+ my $code = <<'EOF';
+use Moose;
+
+has a1 => (
+ is => 'ro',
+ isa => 'Int',
+ default => 42,
+);
+
+sub foo { 42 }
+EOF
+
+ my $class = 'Test::Class2';
+ save_fragment( $class, $code );
+
+ my $compiler = MooseX::Compiler->new(
+ class => $class,
+ );
+
+ my $compiled = $compiler->compile_class();
+warn $compiled;
+
+ like(
+ $compiled,
+ qr/sub new {.+\n}\n/s,
+ 'compiled code has a constructor'
+ );
+}
+
done_testing();