Add a missing semi-colon.
[gitmo/Moose.git] / t / 100_bugs / 012_DEMOLISH_eats_mini.t
CommitLineData
3a0c064a 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More no_plan => 1;
7use Test::Exception;
8
9BEGIN {
10 use_ok('Moose');
11 use_ok('Moose::Util::TypeConstraints');
12}
13
14{
15 package Foo;
16 use Moose;
17
18 has 'bar' => (
19 is => 'ro',
20 required => 1,
21 );
22
23 # Defining this causes the FIRST call to Baz->new w/o param to fail,
24 # if no call to ANY Moose::Object->new was done before.
25 sub DEMOLISH {
26 my ( $self ) = @_;
27 }
28}
29
30my $obj = eval { Foo->new; };
31::like( $@, qr/is required/, "... Foo plain" );
32::is( $obj, undef, "... the object is undef" );
33
341;
35