update repo to point to github
[gitmo/Moo.git] / t / sub-quote.t
index c610766..301366e 100644 (file)
@@ -21,8 +21,8 @@ ok(!keys %EVALED, 'Nothing evaled yet');
 my $u_one = unquote_sub $one;
 
 is_deeply(
-  [ keys %EVALED ], [ qw(one two) ],
-  'Both subs evaled'
+  [ sort keys %EVALED ], [ qw(one) ],
+  'subs one evaled'
 );
 
 is($one->(), 42, 'One (quoted version)');
@@ -47,4 +47,16 @@ like(
   'exception contains correct name'
 );
 
+quote_sub 'Foo::four' => q{
+  return 5;
+};
+
+my $quoted = quoted_from_sub(\&Foo::four);
+like $quoted->[1], qr/return 5;/,
+  'can get quoted from installed sub';
+Foo::four();
+my $quoted2 = quoted_from_sub(\&Foo::four);
+is $quoted2->[1], undef,
+  "can't get quoted from installed sub after undefer";
+
 done_testing;