Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-shell
Commits
06e6e879
Commit
06e6e879
authored
May 18, 2013
by
ash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specifications for the 'bad paths' in mv-projects, and logging.
parent
15bec205
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
spec/gitlab_projects_spec.rb
spec/gitlab_projects_spec.rb
+20
-0
No files found.
spec/gitlab_projects_spec.rb
View file @
06e6e879
...
...
@@ -60,6 +60,26 @@ describe GitlabProjects do
File
.
exists?
(
new_repo_path
).
should
be_true
end
it
"should fail if no destination path is provided"
do
incomplete
=
build_gitlab_projects
(
'mv-project'
,
repo_name
)
$logger
.
should_receive
(
:error
).
with
(
"mv-project failed: no destination path provided."
)
incomplete
.
exec
.
should
be_false
end
it
"should fail if the source path doesn't exist"
do
bad_source
=
build_gitlab_projects
(
'mv-project'
,
'bad-src.git'
,
'dest.git'
)
$logger
.
should_receive
(
:error
).
with
(
"mv-project failed: source path <
#{
tmp_repos_path
}
/bad-src.git> does not exist."
)
bad_source
.
exec
.
should
be_false
end
it
"should fail if the destination path already exists"
do
FileUtils
.
mkdir_p
(
File
.
join
(
tmp_repos_path
,
'already-exists.git'
))
bad_dest
=
build_gitlab_projects
(
'mv-project'
,
repo_name
,
'already-exists.git'
)
message
=
"mv-project failed: destination path <
#{
tmp_repos_path
}
/already-exists.git> already exists."
$logger
.
should_receive
(
:error
).
with
(
message
)
bad_dest
.
exec
.
should
be_false
end
it
"should log an mv-project event"
do
message
=
"Moving project
#{
repo_name
}
from <
#{
tmp_repo_path
}
> to <
#{
new_repo_path
}
>."
$logger
.
should_receive
(
:info
).
with
(
message
)
...
...
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