Commit | Line | Data |
f2ca7ada |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
92c04d5e |
6 | use Test::Builder::Tester tests => 5; |
f2ca7ada |
7 | use Test::More; |
8 | |
9 | BEGIN { |
10 | use_ok('Test::Moose'); |
11 | } |
12 | |
13 | { |
14 | package Foo; |
15 | use Moose; |
16 | } |
17 | |
92c04d5e |
18 | { |
19 | package Bar; |
20 | use Moose; |
21 | } |
22 | |
f2ca7ada |
23 | package main; |
24 | |
25 | test_out("ok 1", "not ok 2"); |
26 | test_fail(+2); |
92c04d5e |
27 | my $ret = with_immutable { |
f2ca7ada |
28 | ok(Foo->meta->is_mutable); |
29 | } qw(Foo); |
92c04d5e |
30 | test_test('with_immutable failure'); |
31 | ok(!$ret, "one of our tests failed"); |
f2ca7ada |
32 | |
92c04d5e |
33 | test_out("ok 1", "ok 2"); |
34 | $ret = with_immutable { |
35 | ok(Bar->meta->find_method_by_name('new')); |
36 | } qw(Bar); |
37 | test_test('with_immutable success'); |
38 | ok($ret, "all tests succeeded"); |