}
}
-eval <<'EOF';
+{
package Role;
use MooseX::Role::Parameterized;
use MooseX::ClassAttribute;
- role {};
+
+ parameter foo => (is => 'rw');
+
+ role {
+ my $p = shift;
+
+ class_has $p => (is => 'rw');
+ };
package Class;
use Moose;
- with 'Role';
-EOF
+ with 'Role' => { foo => 'foo' };
+}
+
+ok((my $instance = Class->new), 'instance');
-ok((not $@), 'used MooseX::ClassAttribute in MooseX::Role::Parameterized role');
-diag $@ if $@;
+lives_and {
+ $instance->foo('bar');
+ is $instance->foo, 'bar';
+} 'used class attribute from parameterized role';
done_testing;