# Copyright (c) 2009-2010 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: RealmRole2.bunit,v 1.6 2010/12/24 13:44:25 nagler Exp $ ShellUtil(); [ [qw(-realm fourem list *all_members)] => qr{MEMBER -\s.*ACCOUNTANT -\s.*ADMINISTRATOR -\s}is, [qw(-realm fourem list *all_members-all_admins)] => sub { my(undef, $actual) = @_; assert_not_equals(qr{ACCOUNTANT|ADMINISTRATOR}is, $actual->[0]); assert_equals(qr{MEMBER -\s}is, $actual->[0]); return 1; }, [qw(-realm fourem edit *all_admins +ADMIN_WRITE)] => not_die(), map(( ['-realm', $_, 'list_enabled_categories'] => sub { my(undef, $actual) = @_; assert_equals(1, int(@{[${$actual->[0]} =~ m{(mail_send_access_)}g]})); return 1; }), qw(fourem motion_forum site-contact site-admin), ), [qw(-realm fourem edit MAIL_RECIPIENT - +ANYBODY)] => not_die(), [qw(-realm fourem edit MAIL_RECIPIENT -)] => not_die(), [qw(-realm fourem list)] => qr{^RealmRole\(\);\nRealmRole\(qw\(-r fourem edit ANONYMOUS -}s, [qw(-realm fourem list USER)] => qr{^RealmRole\(\);\nRealmRole\(qw\(-r fourem edit USER -\n \+ANYBODY\n \+ANY_USER}s, [qw(-realm motion_forum edit_categories -open_results_motion)] => not_die(), [qw(-realm motion_forum list_enabled_categories)] => sub { my(undef, $actual) = @_; assert_not_equals(qr{results_motion}, $actual->[0]); return 1; }, [qw(-realm motion_forum edit_categories +open_results_motion)] => not_die(), [qw(-realm motion_forum list_enabled_categories)] => qr{open_results_motion}, [qw(-realm motion_forum edit_categories +closed_results_motion)] => not_die(), [qw(-realm motion_forum list_enabled_categories)] => sub { my(undef, $actual) = @_; assert_not_equals(qr{open_results_motion}, $actual->[0]); return qr{closed_results_motion}; }, [qw(-realm motion_forum edit_categories +open_results_motion)] => not_die(), [qw(-realm motion_forum list_enabled_categories)] => qr{open_results_motion}, [is_category => 'feature_wiki'] => 1, [is_category => 'feature_not_one'] => 0, ];