From 2b735d5acb55cd8925a10566263a11dd8f32604e Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 27 May 2009 22:19:29 -0500 Subject: make the basic test just be the synopsis test --- t/001-basic.t | 35 ----------------------------------- t/001-synopsis.t | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 35 deletions(-) delete mode 100644 t/001-basic.t create mode 100644 t/001-synopsis.t diff --git a/t/001-basic.t b/t/001-basic.t deleted file mode 100644 index 89bde54..0000000 --- a/t/001-basic.t +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use Test::More tests => 4; - -package Foo; -use Moose; - -sub foo { "FOO" } -sub bar { shift; join '-', @_ } - -package Foo::Sub; -use Moose; -use MooseX::Mangle; -extends 'Foo'; - -mangle_return foo => sub { - my $self = shift; - my ($foo) = @_; - return lc($foo) . 'BAR'; -}; - -mangle_args bar => sub { - my $self = shift; - my ($a, $b, $c) = @_; - return ($b, $c, $a); -}; - -package main; -my $foo = Foo->new; -my $foosub = Foo::Sub->new; -is($foo->foo, 'FOO', 'unmodified method foo'); -is($foo->bar('a', 'b', 'c'), 'a-b-c', 'unmodified method bar'); -is($foosub->foo, 'fooBAR', "foo's return is mangled"); -is($foosub->bar('a', 'b', 'c'), 'b-c-a', "bar's args are mangled"); diff --git a/t/001-synopsis.t b/t/001-synopsis.t new file mode 100644 index 0000000..89bde54 --- /dev/null +++ b/t/001-synopsis.t @@ -0,0 +1,35 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More tests => 4; + +package Foo; +use Moose; + +sub foo { "FOO" } +sub bar { shift; join '-', @_ } + +package Foo::Sub; +use Moose; +use MooseX::Mangle; +extends 'Foo'; + +mangle_return foo => sub { + my $self = shift; + my ($foo) = @_; + return lc($foo) . 'BAR'; +}; + +mangle_args bar => sub { + my $self = shift; + my ($a, $b, $c) = @_; + return ($b, $c, $a); +}; + +package main; +my $foo = Foo->new; +my $foosub = Foo::Sub->new; +is($foo->foo, 'FOO', 'unmodified method foo'); +is($foo->bar('a', 'b', 'c'), 'a-b-c', 'unmodified method bar'); +is($foosub->foo, 'fooBAR', "foo's return is mangled"); +is($foosub->bar('a', 'b', 'c'), 'b-c-a', "bar's args are mangled"); -- cgit v1.2.3