Commit | Line | Data |
---|---|---|
f2ca7ada | 1 | #!/usr/bin/perl |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
a28e50e4 | 6 | use Test::Builder::Tester; |
f2ca7ada | 7 | use Test::More; |
8 | ||
9153f80b | 9 | plan skip_all => 'These tests are only for Test::Builder 0.9x' |
10 | if Test::Builder->VERSION >= 1.005; | |
11 | ||
28fdde7f | 12 | use Test::Moose; |
f2ca7ada | 13 | |
14 | { | |
15 | package Foo; | |
16 | use Moose; | |
17 | } | |
18 | ||
92c04d5e | 19 | { |
20 | package Bar; | |
21 | use Moose; | |
22 | } | |
23 | ||
f2ca7ada | 24 | package main; |
25 | ||
26 | test_out("ok 1", "not ok 2"); | |
27 | test_fail(+2); | |
92c04d5e | 28 | my $ret = with_immutable { |
f2ca7ada | 29 | ok(Foo->meta->is_mutable); |
30 | } qw(Foo); | |
92c04d5e | 31 | test_test('with_immutable failure'); |
32 | ok(!$ret, "one of our tests failed"); | |
f2ca7ada | 33 | |
92c04d5e | 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"); | |
a28e50e4 | 40 | |
41 | done_testing; |