die on attributes with no methods and no is => 'bare'
[gitmo/Moose.git] / t / 020_attributes / 026_attribute_without_any_methods.t
CommitLineData
ae907ae0 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More tests => 2;
7
8use Moose ();
9use Moose::Meta::Class;
10
11my $meta = Moose::Meta::Class->create_anon_class;
12
13#local $TODO = 'not implemented yet';
14
15eval { $meta->add_attribute('foo') };
16like $@, qr/Attribute \(foo\) has no associated methods/,
17 'correct error message';
18
19ok(
20 eval { $meta->add_attribute('bar', is => 'bare'); 1 },
21 'add attribute with no methods',
22) or diag $@;