Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
c75fc9c7
Commit
c75fc9c7
authored
Feb 04, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove gitolite stub
parent
935b6ae6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
24 deletions
+21
-24
spec/spec_helper.rb
spec/spec_helper.rb
+0
-3
spec/support/gitolite_stub.rb
spec/support/gitolite_stub.rb
+0
-21
spec/support/stubbed_repository.rb
spec/support/stubbed_repository.rb
+21
-0
No files found.
spec/spec_helper.rb
View file @
c75fc9c7
...
@@ -24,7 +24,6 @@ RSpec.configure do |config|
...
@@ -24,7 +24,6 @@ RSpec.configure do |config|
config
.
mock_with
:rspec
config
.
mock_with
:rspec
config
.
include
LoginHelpers
,
type: :request
config
.
include
LoginHelpers
,
type: :request
config
.
include
GitoliteStub
config
.
include
FactoryGirl
::
Syntax
::
Methods
config
.
include
FactoryGirl
::
Syntax
::
Methods
config
.
include
Devise
::
TestHelpers
,
type: :controller
config
.
include
Devise
::
TestHelpers
,
type: :controller
...
@@ -34,8 +33,6 @@ RSpec.configure do |config|
...
@@ -34,8 +33,6 @@ RSpec.configure do |config|
config
.
use_transactional_fixtures
=
false
config
.
use_transactional_fixtures
=
false
config
.
before
do
config
.
before
do
stub_gitolite!
# Use tmp dir for FS manipulations
# Use tmp dir for FS manipulations
temp_repos_path
=
Rails
.
root
.
join
(
'tmp'
,
'test-git-base-path'
)
temp_repos_path
=
Rails
.
root
.
join
(
'tmp'
,
'test-git-base-path'
)
Gitlab
.
config
.
gitolite
.
stub
(
repos_path:
temp_repos_path
)
Gitlab
.
config
.
gitolite
.
stub
(
repos_path:
temp_repos_path
)
...
...
spec/support/gitolite_stub.rb
deleted
100644 → 0
View file @
935b6ae6
module
GitoliteStub
def
stub_gitolite!
stub_gitlab_gitolite
stub_gitolite_admin
end
def
stub_gitolite_admin
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
)
})
gitolite_config
.
as_null_object
Gitlab
::
GitoliteConfig
.
stub
(
new:
gitolite_config
)
end
end
spec/support/stubbed_repository.rb
View file @
c75fc9c7
require
"repository"
require
"repository"
require
"project"
require
"project"
require
"shell"
# Stubs out all Git repository access done by models so that specs can run
# Stubs out all Git repository access done by models so that specs can run
# against fake repositories without Grit complaining that they don't exist.
# against fake repositories without Grit complaining that they don't exist.
...
@@ -36,3 +37,23 @@ class GitLabTestRepo < Repository
...
@@ -36,3 +37,23 @@ class GitLabTestRepo < Repository
@repo
||=
Grit
::
Repo
.
new
(
Rails
.
root
.
join
(
'tmp'
,
'repositories'
,
'gitlabhq'
))
@repo
||=
Grit
::
Repo
.
new
(
Rails
.
root
.
join
(
'tmp'
,
'repositories'
,
'gitlabhq'
))
end
end
end
end
module
Gitlab
class
Shell
def
add_repository
name
true
end
def
remove_repository
name
true
end
def
add_key
name
,
key
true
end
def
remove_key
key
true
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment