Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Small enhancement in the transactiona-authorized author test #3

Open
wants to merge 2 commits into from

1 participant

Daniel Ruoso
Daniel Ruoso

Also add missing prereq in dist.ini

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 21, 2011
  1. Daniel Ruoso

    documents prereq

    ruoso authored
  2. Daniel Ruoso

    enhance the test

    ruoso authored
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 8 deletions.
  1. +2 −0  dist.ini
  2. +8 −8 xt/author/transactional-authorized.t
2  dist.ini
View
@@ -26,3 +26,5 @@ disable_pod_coverage_tests = 1
[Prereq]
Task::Weaken = 0
+Parse::Method::Signatures = 0
+MooseX::Meta::TypeConstraint::ForceCoercion = 0
16 xt/author/transactional-authorized.t
View
@@ -11,10 +11,10 @@ use Test::Moose;
has schema => (is => 'ro');
# this was supposed to die, but the trait is not really applied.
- method m01 does Transactional does Authorized(requires => ['foo']) { 'm01' }
- method m02 does Transactional { 'm02' }
- method m03 does Authorized(requires => ['gah']) { 'm03' }
- method m04 does Transactional does Authorized(requires => ['gah']) { 'm01' }
+ method m01($p1, $p2) does Transactional does Authorized(requires => ['foo']) { 'm01'.$p1.$p2 }
+ method m02($p1, $p2) does Transactional { 'm02'.$p1.$p2 }
+ method m03($p1, $p2) does Authorized(requires => ['gah']) { 'm03'.$p1.$p2 }
+ method m04($p1, $p2) does Transactional does Authorized(requires => ['gah']) { 'm01'.$p1.$p2 }
};
{ package MySchema;
@@ -33,15 +33,15 @@ use Test::Moose;
my $meth = MyClass->meta->get_method('m01');
my $obj = MyClass->new({user => MyUser->new, schema => MySchema->new });
-is($obj->m01, 'txn_do m01', 'applying both roles work.');
-is($obj->m02, 'txn_do m02', 'Applyign just Transactional');
+is($obj->m01(1,2), 'txn_do m0112', 'applying both roles work.');
+is($obj->m02(3,4), 'txn_do m0234', 'Applyign just Transactional');
eval {
- $obj->m03;
+ $obj->m03(5,6);
};
like($@.'', qr(Access Denied)i, $@);
eval {
- $obj->m04;
+ $obj->m04(7,8);
};
like($@.'', qr(Access Denied)i, $@);
Something went wrong with that request. Please try again.