Changelogging
[gitmo/Mouse.git] / t / 600_todo_tests / 008_replacing_super_methods.t
CommitLineData
fde8e43f 1#!/usr/bin/env 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;
5use strict;
6use warnings;
7use Test::More;
8
9my ($super_called, $sub_called, $new_super_called) = (0, 0, 0);
10{
11 package Foo;
12 use Mouse;
13
14 sub foo { $super_called++ }
15}
16
17{
18 package Foo::Sub;
19 use Mouse;
20 extends 'Foo';
21
22 override foo => sub {
23 $sub_called++;
24 super();
25 };
26}
27
28Foo::Sub->new->foo;
29is($super_called, 1, "super called");
30is($new_super_called, 0, "new super not called");
31is($sub_called, 1, "sub called");
32
33($super_called, $sub_called, $new_super_called) = (0, 0, 0);
34
35Foo->meta->add_method(foo => sub {
36 $new_super_called++;
37});
38
39Foo::Sub->new->foo;
40{ local $TODO = "super doesn't get replaced";
41is($super_called, 0, "super not called");
42is($new_super_called, 1, "new super called");
43}
44is($sub_called, 1, "sub called");
45
46done_testing;