Whitespace trim tests
[gitmo/MooseX-Storage.git] / t / 004_w_cycles.t
index f7e60c1..5e72ec1 100644 (file)
@@ -15,7 +15,7 @@ BEGIN {
 This test demonstrates two things:
 
 - cycles will not work in the default engine
-- you can use a special metaclass to tell 
+- you can use a special metaclass to tell
   MooseX::Storage to skip an attribute
 
 =cut
@@ -34,12 +34,12 @@ This test demonstrates two things:
 {
     my $circular = Circular->new;
     isa_ok($circular, 'Circular');
-    
+
     $circular->cycle($circular);
-    
+
     throws_ok {
         $circular->pack;
-    } qr/^Basic Engine does not support cycles/, 
+    } qr/^Basic Engine does not support cycles/,
     '... cannot collapse a cycle with the basic engine';
 }
 
@@ -49,7 +49,7 @@ This test demonstrates two things:
 
     throws_ok {
         Circular->unpack($packed_circular);
-    } qr/^Basic Engine does not support cycles/, 
+    } qr/^Basic Engine does not support cycles/,
     '... cannot expand a cycle with the basic engine';
 }
 
@@ -62,19 +62,19 @@ This test demonstrates two things:
     with Storage;
 
     has 'node' => (is => 'rw');
-    
+
     has 'children' => (
-        is      => 'ro', 
-        isa     => 'ArrayRef', 
+        is      => 'ro',
+        isa     => 'ArrayRef',
         default => sub {[]}
     );
-    
+
     has 'parent' => (
         metaclass => 'DoNotSerialize',
-        is        => 'rw', 
+        is        => 'rw',
         isa       => 'Tree',
     );
-    
+
     sub add_child {
         my ($self, $child) = @_;
         $child->parent($self);
@@ -85,28 +85,28 @@ This test demonstrates two things:
 {
     my $t = Tree->new(node => 100);
     isa_ok($t, 'Tree');
-    
+
     is_deeply(
-        $t->pack, 
+        $t->pack,
         {
             __CLASS__ => 'Tree',
             node      => 100,
             children  => [],
         },
     '... got the right packed version');
-    
+
     my $t2 = Tree->new(node => 200);
-    isa_ok($t2, 'Tree');    
-    
+    isa_ok($t2, 'Tree');
+
     $t->add_child($t2);
-    
+
     is_deeply($t->children, [ $t2 ], '... got the right children in $t');
-    
+
     is($t2->parent, $t, '... created the cycle correctly');
-    isa_ok($t2->parent, 'Tree');        
-    
+    isa_ok($t2->parent, 'Tree');
+
     is_deeply(
-        $t->pack, 
+        $t->pack,
         {
             __CLASS__ => 'Tree',
             node      => 100,
@@ -114,18 +114,18 @@ This test demonstrates two things:
                {
                    __CLASS__ => 'Tree',
                    node      => 200,
-                   children  => [],            
-               } 
+                   children  => [],
+               }
             ],
         },
-    '... got the right packed version (with parent attribute skipped in child)');    
-    
+    '... got the right packed version (with parent attribute skipped in child)');
+
     is_deeply(
-        $t2->pack, 
+        $t2->pack,
         {
             __CLASS__ => 'Tree',
             node      => 200,
-            children  => [],            
+            children  => [],
         },
     '... got the right packed version (with parent attribute skipped)');
 }
@@ -135,7 +135,7 @@ This test demonstrates two things:
     use Moose;
     use MooseX::Storage;
     with Storage;
-    
+
     has 'x' => ( is => 'rw', isa => 'HashRef' );
     has 'y' => ( is => 'rw', isa => 'HashRef' );
 }
@@ -154,13 +154,13 @@ This test demonstrates two things:
         ok( Double->unpack( $pack || {} ),
                                 "   And unpacked again" );
     }
-    
+
     my $pack = $double->pack( engine_traits => [qw/DisableCycleDetection/] );
     ok( $pack,                  "   Object packs when cycle check is disabled");
     ok( Double->unpack( $pack ),
                                 "   And unpacked again" );
 
-}    
+}
 
 ### the same as above, but now done with a trait
 ### this fails with cycle detection on
@@ -168,7 +168,7 @@ This test demonstrates two things:
     use Moose;
     use MooseX::Storage;
     with Storage( traits => ['DisableCycleDetection'] );
-    
+
     has 'x' => ( is => 'rw', isa => 'HashRef' );
     has 'y' => ( is => 'rw', isa => 'HashRef' );
 }
@@ -180,4 +180,4 @@ This test demonstrates two things:
     ok( $pack,              "Object packs with DisableCycleDetection trait");
     ok( DoubleNoCycle->unpack( $pack ),
                             "   Unpacked again" );
-}    
+}