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
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
Kazuhiko Shiozaki
gitlab-shell
Commits
e71fcd9e
Commit
e71fcd9e
authored
Mar 07, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use IO.popen instead of Kernel#` to read refs
parent
4e22874b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
spec/gitlab_projects_spec.rb
spec/gitlab_projects_spec.rb
+12
-8
No files found.
spec/gitlab_projects_spec.rb
View file @
e71fcd9e
...
...
@@ -31,8 +31,8 @@ describe GitlabProjects do
it
"should create a branch"
do
gl_projects_create
.
exec
gl_projects
.
exec
branch_ref
=
`cd
#{
tmp_repo_path
}
&& git rev-parse test_branch`
.
strip
master_ref
=
`cd
#{
tmp_repo_path
}
&& git rev-parse master`
.
strip
branch_ref
=
capture_in_tmp_repo
(
%W(git rev-parse test_branch)
)
master_ref
=
capture_in_tmp_repo
(
%W(git rev-parse master)
)
branch_ref
.
should
==
master_ref
end
end
...
...
@@ -49,9 +49,9 @@ describe GitlabProjects do
it
"should remove a branch"
do
gl_projects_create
.
exec
gl_projects_create_branch
.
exec
branch_ref
=
`cd
#{
tmp_repo_path
}
&& git rev-parse test_branch`
.
strip
branch_ref
=
capture_in_tmp_repo
(
%W(git rev-parse test_branch)
)
gl_projects
.
exec
branch_del
=
`cd
#{
tmp_repo_path
}
&& git rev-parse test_branch`
.
strip
branch_del
=
capture_in_tmp_repo
(
%W(git rev-parse test_branch)
)
branch_del
.
should_not
==
branch_ref
end
end
...
...
@@ -65,8 +65,8 @@ describe GitlabProjects do
it
"should create a tag"
do
gl_projects_create
.
exec
gl_projects
.
exec
tag_ref
=
`cd
#{
tmp_repo_path
}
&& git rev-parse test_tag`
.
strip
master_ref
=
`cd
#{
tmp_repo_path
}
&& git rev-parse master`
.
strip
tag_ref
=
capture_in_tmp_repo
(
%W(git rev-parse test_tag)
)
master_ref
=
capture_in_tmp_repo
(
%W(git rev-parse master)
)
tag_ref
.
should
==
master_ref
end
end
...
...
@@ -83,9 +83,9 @@ describe GitlabProjects do
it
"should remove a branch"
do
gl_projects_create
.
exec
gl_projects_create_tag
.
exec
branch_ref
=
`cd
#{
tmp_repo_path
}
&& git rev-parse test_tag`
.
strip
branch_ref
=
capture_in_tmp_repo
(
%W(git rev-parse test_tag)
)
gl_projects
.
exec
branch_del
=
`cd
#{
tmp_repo_path
}
&& git rev-parse test_tag`
.
strip
branch_del
=
capture_in_tmp_repo
(
%W(git rev-parse test_tag)
)
branch_del
.
should_not
==
branch_ref
end
end
...
...
@@ -300,4 +300,8 @@ describe GitlabProjects do
def
repo_name
'gitlab-ci.git'
end
def
capture_in_tmp_repo
(
cmd
)
IO
.
popen
(
cmd
,
chdir:
tmp_repo_path
).
read
.
strip
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