Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 500_test_moose / 005_with_immutable.t
CommitLineData
ca5d8e24 1#!/usr/bin/perl
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;
5
6use strict;
7use warnings;
8
9use Test::Builder::Tester;
10use Test::More;
11
12BEGIN {
13 use_ok('Test::Mouse');
14}
15
16{
17 package Foo;
18 use Mouse;
19}
20
21{
22 package Bar;
23 use Mouse;
24}
25
26package main;
27
28test_out("ok 1", "not ok 2");
29test_fail(+2);
30my $ret = with_immutable {
31 ok(Foo->meta->is_mutable);
32} qw(Foo);
33test_test('with_immutable failure');
34ok(!$ret, "one of our tests failed");
35
36test_out("ok 1", "ok 2");
37$ret = with_immutable {
38 ok(Bar->meta->find_method_by_name('new'));
39} qw(Bar);
40test_test('with_immutable success');
41ok($ret, "all tests succeeded");
42
43done_testing;