Skip to content

Commit

Permalink
Item11983: Friendlier assert messages
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x01@15610 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
PaulHarvey authored and PaulHarvey committed Oct 17, 2012
1 parent 9c5cce9 commit 5ffcaf0
Showing 1 changed file with 14 additions and 21 deletions.
35 changes: 14 additions & 21 deletions UnitTestContrib/test/unit/AccessControlTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -453,27 +453,20 @@ THIS

sub _checkSettings {
my ( $this, $meta ) = @_;

$this->assert(
!$meta->haveAccess( 'VIEW', $MrOrange ),
" 'VIEW' $this->{test_web}.$this->{test_topic}"
);
$this->assert(
$meta->haveAccess( 'VIEW', $MrGreen ),
" 'VIEW' $this->{test_web}.$this->{test_topic}"
);
$this->assert(
!$meta->haveAccess( 'VIEW', $MrYellow ),
" 'VIEW' $this->{test_web}.$this->{test_topic}"
);
$this->assert(
!$meta->haveAccess( 'VIEW', $MrWhite ),
" 'VIEW' $this->{test_web}.$this->{test_topic}"
);
$this->assert(
!$meta->haveAccess( 'VIEW', $MrBlue ),
" 'VIEW' $this->{test_web}.$this->{test_topic}"
);
my $should_not =
" should not be able to 'VIEW' $this->{test_web}.$this->{test_topic}";
my $should =
" should be able to 'VIEW' $this->{test_web}.$this->{test_topic}";

$this->assert( $meta->haveAccess( 'VIEW', $MrGreen ), $MrGreen . $should );
$this->assert( !$meta->haveAccess( 'VIEW', $MrOrange ),
$MrOrange . $should_not );
$this->assert( !$meta->haveAccess( 'VIEW', $MrYellow ),
$MrYellow . $should_not );
$this->assert( !$meta->haveAccess( 'VIEW', $MrWhite ),
$MrWhite . $should_not );
$this->assert( !$meta->haveAccess( 'VIEW', $MrBlue ),
$MrBlue . $should_not );

return;
}
Expand Down

0 comments on commit 5ffcaf0

Please sign in to comment.