use warnings FATAL => 'all';
use strict;
-package Foo;
-use Moose;
-with 'MooseX::Getopt';
-use MooseX::Types::Path::Class;
+{
-has 'dir' => (
- is => 'ro',
- isa => 'Path::Class::Dir',
- required => 1,
- coerce => 1,
-);
+ package Foo;
+ use Moose;
+ use MooseX::Types::Path::Class;
-has 'file' => (
- is => 'ro',
- isa => 'Path::Class::File',
- required => 1,
- coerce => 1,
-);
+ has 'dir' => (
+ is => 'ro',
+ isa => 'Path::Class::Dir',
+ required => 1,
+ coerce => 1,
+ );
+
+ has 'file' => (
+ is => 'ro',
+ isa => 'Path::Class::File',
+ required => 1,
+ coerce => 1,
+ );
+}
+
+{
-package Bar;
-use Moose;
-with 'MooseX::Getopt';
-use MooseX::Types::Path::Class qw( Dir File );
+ package Bar;
+ use Moose;
+ use MooseX::Types::Path::Class qw( Dir File );
-has 'dir' => (
- is => 'ro',
- isa => Dir,
- required => 1,
- coerce => 1,
-);
+ has 'dir' => (
+ is => 'ro',
+ isa => Dir,
+ required => 1,
+ coerce => 1,
+ );
-has 'file' => (
- is => 'ro',
- isa => File,
- required => 1,
- coerce => 1,
-);
+ has 'file' => (
+ is => 'ro',
+ isa => File,
+ required => 1,
+ coerce => 1,
+ );
+}
package main;
use Test::More;
use Path::Class;
-plan tests => 20;
+plan tests => 10;
my $dir = dir('', 'tmp');
my $file = file('', 'tmp', 'foo');
};
for my $class (qw(Foo Bar)) {
- my $o;
-
-# $o = $class->new( dir => '/tmp', file => [ '', 'tmp', 'foo' ] );
- $o = $class->new( dir => "$dir", file => [ '', 'tmp', 'foo' ] );
- isa_ok( $o, $class );
- $check->($o);
- @ARGV = qw(
- --dir
- /tmp
- --file
- /tmp/foo
- );
- $o = $class->new_with_options;
+ my $o = $class->new( dir => "$dir", file => [ '', 'tmp', 'foo' ] );
isa_ok( $o, $class );
$check->($o);
}