Update Changes
[gitmo/Mouse.git] / t / 201-squirrel.t
CommitLineData
692e1bcd 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More;
7
8{
9 package Foo;
10 use Squirrel;
11
12 has foo => (
13 isa => "Int",
14 is => "rw",
15 );
16}
17
18# note that 'Foo' is defined before this, to prevent Moose being loaded from
19# affecting its definition
20
21BEGIN {
22 plan skip_all => "Moose required for this test" unless eval { require Moose };
23 plan 'no_plan';
24}
25
26{
27 package Bar;
28 use Squirrel;
29
30 has foo => (
31 isa => "Int",
32 is => "rw",
33 );
34}
35
36my $foo = Foo->new( foo => 3 );
37
38isa_ok( $foo, "Foo" );
39
40isa_ok( $foo, "Mouse::Object" );
41
42is( $foo->foo, 3, "accessor" );
43
44
45my $bar = Bar->new( foo => 3 );
46
47isa_ok( $bar, "Bar" );
48isa_ok( $bar, "Moose::Object" );
49
50is( $bar->foo, 3, "accessor" );