Regenerate test files
[gitmo/Mouse.git] / t / 020_attributes / 018_no_init_arg.t
CommitLineData
4060c871 1#!/usr/bin/perl
fde8e43f 2# This is automatically generated by author/import-moose-test.pl.
3# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4use t::lib::MooseCompat;
4060c871 5
6use strict;
7use warnings;
8
fde8e43f 9use Test::More;
4060c871 10use Test::Exception;
11
12
13
14{
15 package Foo;
16 use Mouse;
17
18 eval {
19 has 'foo' => (
20 is => "rw",
21 init_arg => undef,
22 );
23 };
24 ::ok(!$@, '... created the attr okay');
25}
26
27{
28 my $foo = Foo->new( foo => "bar" );
29 isa_ok($foo, 'Foo');
30
31 is( $foo->foo, undef, "field is not set via init arg" );
32
33 $foo->foo("blah");
34
35 is( $foo->foo, "blah", "field is set via setter" );
36}
fde8e43f 37
38done_testing;