Fix bug when handling upper/mixedcase accessors
[gitmo/MooseX-Getopt.git] / t / 103_uc_bug.t
diff --git a/t/103_uc_bug.t b/t/103_uc_bug.t
new file mode 100644 (file)
index 0000000..79f5598
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 3;
+
+{
+    package App;
+    use Moose;
+    with qw(MooseX::Getopt);
+
+    has 'TrackingNumber' => (
+        is  => 'rw',
+        isa => 'Str',
+    );
+
+    has 'otherparam' => (
+        is  => 'rw',
+        isa => 'Str',
+    );
+}
+
+{
+    local @ARGV = ('--TrackingNumber','1Z1234567812345670','--otherparam','foo');
+
+    my $app = App->new_with_options;
+    isa_ok($app, 'App');
+    is($app->TrackingNumber, '1Z1234567812345670', '... TrackingNumber is as expected');
+    is($app->otherparam, 'foo', '... otherparam is as expected');
+}