From: Stevan Little Date: Thu, 5 Jun 2008 13:51:32 +0000 (+0000) Subject: failing tests X-Git-Tag: 0_15~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0df9248ea02665c6ed613887a83ff6f0621fa66f;p=gitmo%2FMooseX-Getopt.git failing tests --- diff --git a/t/009_gld_and_explicit_options.t b/t/009_gld_and_explicit_options.t new file mode 100644 index 0000000..e81b300 --- /dev/null +++ b/t/009_gld_and_explicit_options.t @@ -0,0 +1,49 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Test::More; +use Test::Exception; + +BEGIN { + eval "use Getopt::Long::Descriptive;"; + plan skip_all => "Getopt::Long::Descriptive required for this test" if $@; + plan tests => 5; + use_ok('MooseX::Getopt'); +} + +{ + package Testing::Foo; + use Moose; + + with 'MooseX::Getopt'; + + has 'bar' => ( + is => 'ro', + isa => 'Int', + required => 1, + ); + + has 'baz' => ( + is => 'ro', + isa => 'Int', + required => 1, + ); +} + +our @ARGV = qw(bar 10); + +my $foo; +lives_ok { + $foo = Testing::Foo->new_with_options(baz => 100); +} '... this should work'; +isa_ok($foo, 'Testing::Foo'); + +is($foo->bar, 10, '... got the right values'); +is($foo->baz, 100, '... got the right values'); + + + + +