Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
01c86d92
Commit
01c86d92
authored
Mar 30, 2014
by
Boris Bügling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added specs for testing if git options are present
parent
c16b69bb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
11 deletions
+29
-11
sources_manager_spec.rb
spec/unit/sources_manager_spec.rb
+29
-11
No files found.
spec/unit/sources_manager_spec.rb
View file @
01c86d92
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
def
set_up_test_repo_for_update
set_up_test_repo
upstream
=
SpecHelper
.
temporary_directory
+
'upstream'
FileUtils
.
cp_r
(
test_repo_path
,
upstream
)
Dir
.
chdir
(
test_repo_path
)
do
`git remote add origin
#{
upstream
}
`
`git remote -v`
`git fetch -q`
`git branch --set-upstream-to=origin/master master`
`git config branch.master.rebase true`
end
config
.
repos_dir
=
SpecHelper
.
tmp_repos_path
end
module
Pod
module
Pod
describe
SourcesManager
do
describe
SourcesManager
do
...
@@ -87,22 +101,26 @@ module Pod
...
@@ -87,22 +101,26 @@ module Pod
extend
SpecHelper
::
TemporaryRepos
extend
SpecHelper
::
TemporaryRepos
it
"update source backed by a git repository"
do
it
"update source backed by a git repository"
do
set_up_test_repo
set_up_test_repo_for_update
upstream
=
SpecHelper
.
temporary_directory
+
'upstream'
FileUtils
.
cp_r
(
test_repo_path
,
upstream
)
Dir
.
chdir
(
test_repo_path
)
do
`git remote add origin
#{
upstream
}
`
`git remote -v`
`git fetch -q`
`git branch --set-upstream-to=origin/master master`
`git config branch.master.rebase true`
end
config
.
repos_dir
=
SpecHelper
.
tmp_repos_path
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
UI
.
output
.
should
.
match
/Already up-to-date/
UI
.
output
.
should
.
match
/Already up-to-date/
end
end
it
"is robust against user settings for git repos"
do
set_up_test_repo_for_update
SourcesManager
.
expects
(
:git!
).
with
()
{
|
options
|
options
.
should
.
match
/--no-rebase/
}
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
end
it
"doesn't allow merge commits"
do
set_up_test_repo_for_update
SourcesManager
.
expects
(
:git!
).
with
()
{
|
options
|
options
.
should
.
match
/--no-commit/
}
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
end
it
'returns whether a source has a reachable git remote'
do
it
'returns whether a source has a reachable git remote'
do
SourcesManager
.
git_remote_reachable?
(
repo_make
(
'a_new_repo_that_is_new'
)).
should
.
be
.
false
SourcesManager
.
git_remote_reachable?
(
repo_make
(
'a_new_repo_that_is_new'
)).
should
.
be
.
false
SourcesManager
.
git_remote_reachable?
(
SourcesManager
.
master_repo_dir
).
should
.
be
.
true
SourcesManager
.
git_remote_reachable?
(
SourcesManager
.
master_repo_dir
).
should
.
be
.
true
...
...
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