new .gitignore file, stolen from Moose repo
[gitmo/MooseX-UndefTolerant.git] / t / defaults.t
CommitLineData
779ca481 1#!/usr/bin/perl
2
3use Test::More;
4
5package Foo;
6
7use Moose;
8use MooseX::UndefTolerant::Attribute;
9
10has bar => (
11 is => 'rw',
12 traits => ['MooseX::UndefTolerant::Attribute'],
13 default => 'baz'
14);
15
161;
17
18package main;
19
20my $foo = Foo->new( bar => undef );
21is ( $foo->bar, 'baz', 'does the default value get set when passing undef in the constructor' );
22
23done_testing;