Merge branch 'master' of git@github.com:bobtfish/moosex-getopt
[gitmo/MooseX-Getopt.git] / t / 101_argv_bug.t
diff --git a/t/101_argv_bug.t b/t/101_argv_bug.t
new file mode 100644 (file)
index 0000000..6d75ad5
--- /dev/null
@@ -0,0 +1,37 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 3;
+
+use MooseX::Getopt;
+
+{
+    package App;
+    use Moose;
+
+    with 'MooseX::Getopt';
+
+    has 'length' => (
+        is      => 'ro',
+        isa     => 'Int',
+        default => 24,
+    );
+
+    has 'verbose' => (
+        is     => 'ro',
+        isa    => 'Bool',
+        default => 0,
+    );
+    no Moose;
+}
+
+{
+    my $app = App->new_with_options(argv => [ '--verbose', '--length', 50 ]);
+    isa_ok($app, 'App');
+
+    ok($app->verbose, '... verbosity is turned on as expected');
+    is($app->length, 50, '... length is 50 as expected');
+}
+