add travis configuration
[gitmo/Moose.git] / t / test_moose / with_immutable.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::Builder::Tester;
7 use Test::More;
8
9 plan skip_all => 'These tests are only for Test::Builder 0.9x'
10     if Test::Builder->VERSION >= 1.005;
11
12 use Test::Moose;
13
14 {
15     package Foo;
16     use Moose;
17 }
18
19 {
20     package Bar;
21     use Moose;
22 }
23
24 package main;
25
26 test_out("ok 1", "not ok 2");
27 test_fail(+2);
28 my $ret = with_immutable {
29     ok(Foo->meta->is_mutable);
30 } qw(Foo);
31 test_test('with_immutable failure');
32 ok(!$ret, "one of our tests failed");
33
34 test_out("ok 1", "ok 2");
35 $ret = with_immutable {
36     ok(Bar->meta->find_method_by_name('new'));
37 } qw(Bar);
38 test_test('with_immutable success');
39 ok($ret, "all tests succeeded");
40
41 done_testing;