diff options
Diffstat (limited to 'spec/support/gitolite_stub.rb')
-rw-r--r-- | spec/support/gitolite_stub.rb | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/spec/support/gitolite_stub.rb b/spec/support/gitolite_stub.rb index 037b09cd555..574bb5a12a3 100644 --- a/spec/support/gitolite_stub.rb +++ b/spec/support/gitolite_stub.rb @@ -5,42 +5,16 @@ module GitoliteStub end def stub_gitolite_admin - gitolite_repo = mock( - clean_permissions: true, - add_permission: true - ) - - gitolite_config = mock( - add_repo: true, - get_repo: gitolite_repo, - has_repo?: true - ) - - gitolite_admin = double( - 'Gitolite::GitoliteAdmin', - config: gitolite_config, - save: true, - ) + gitolite_admin = double('Gitolite::GitoliteAdmin') + gitolite_admin.as_null_object Gitolite::GitoliteAdmin.stub(new: gitolite_admin) - end def stub_gitlab_gitolite gitolite_config = double('Gitlab::GitoliteConfig') - gitolite_config.stub( - apply: ->() { yield(self) }, - write_key: true, - rm_key: true, - update_projects: true, - update_project: true, - update_project!: true, - destroy_project: true, - destroy_project!: true, - admin_all_repo: true, - admin_all_repo!: true, - - ) + gitolite_config.stub(apply: ->() { yield(self) }) + gitolite_config.as_null_object Gitlab::GitoliteConfig.stub(new: gitolite_config) end |