remove trailing whitespace
[gitmo/Moose.git] / t / 100_bugs / 011_DEMOLISH_eats_exceptions.t
index 31edb46..4180fe6 100644 (file)
@@ -11,8 +11,10 @@ use Moose::Util::TypeConstraints;
 
 subtype 'FilePath'
     => as 'Str'
-    => where { $_ =~ m#^(/[a-zA-Z0-9_.-]+)+/?$#
-                || $_ =~ m#^([c-zC-Z]:/[a-zA-Z0-9_.-]+)# };
+    # This used to try to _really_ check for a valid Unix or Windows
+    # path, but the regex wasn't quite right, and all we care about
+    # for the tests is that it rejects '/'
+    => where { $_ ne '/' };
 {
     package Baz;
     use Moose;
@@ -113,32 +115,32 @@ sub check_em {
          ::is( $obj, undef, "... the object is undef" );
      }
      {
-         local $@;        
-         my $obj = eval { $pkg->new ( undef ); };
+         local $@;
+         my $obj = eval { $pkg->new ( notanattr => 1 ); };
          ::like( $@, qr/is required/, "... $pkg undef" );
          ::is( $obj, undef, "... the object is undef" );
      }
 
      {
-         local $@;        
+         local $@;
          my $obj = eval { $pkg->new ( %param ); };
          ::like( $@, qr/is required/, "... $pkg undef param" );
          ::is( $obj, undef, "... the object is undef" );
      }
      {
-         local $@;        
+         local $@;
          my $obj = eval { $pkg->new ( path => '/' ); };
          ::like( $@, qr/does not pass the type constraint/, "... $pkg root path forbidden" );
          ::is( $obj, undef, "... the object is undef" );
      }
      {
-         local $@;        
+         local $@;
          my $obj = eval { $pkg->new ( path => '/this_path/does/not_exist' ); };
          ::like( $@, qr/does not exist/, "... $pkg non existing path" );
          ::is( $obj, undef, "... the object is undef" );
      }
      {
-         local $@;        
+         local $@;
          my $obj = eval { $pkg->new ( path => $FindBin::Bin ); };
          ::is( $@, '', "... $pkg no error" );
          ::isa_ok( $obj, $pkg );