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
33509e01
Commit
33509e01
authored
Sep 11, 2012
by
Ray Lillywhite
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specs for updating a cached repo if the specified branch is missing.
parent
f33d3284
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
git_spec.rb
spec/functional/downloader/git_spec.rb
+41
-0
No files found.
spec/functional/downloader/git_spec.rb
View file @
33509e01
...
@@ -197,6 +197,47 @@ module Pod
...
@@ -197,6 +197,47 @@ module Pod
downloader
.
expects
(
:update_cache
).
never
downloader
.
expects
(
:update_cache
).
never
downloader
.
download
downloader
.
download
end
end
it
"updates the cache if the branch is not available"
do
# create the origin repo and the cache
tmp_repo_path
=
temporary_directory
+
'banana-lib-source'
`git clone
#{
fixture
(
'banana-lib'
)
}
#{
tmp_repo_path
}
`
@pod
.
top_specification
.
stubs
(
:source
).
returns
(
:git
=>
tmp_repo_path
,
:branch
=>
'master'
)
downloader
=
Downloader
.
for_pod
(
@pod
)
downloader
.
download
# make a new branch in the origin
branch
=
'test'
Dir
.
chdir
(
tmp_repo_path
)
do
`touch test.txt`
`git checkout -b
#{
branch
}
>/dev/null 2>&1`
`git add test.txt`
`git commit -m 'test'`
end
# require the new branch
pod
=
LocalPod
.
new
(
fixture_spec
(
'banana-lib/BananaLib.podspec'
),
temporary_sandbox
,
Platform
.
ios
)
pod
.
top_specification
.
stubs
(
:source
).
returns
(
:git
=>
tmp_repo_path
,
:branch
=>
branch
)
downloader
=
Downloader
.
for_pod
(
pod
)
downloader
.
download
(
pod
.
root
+
'test.txt'
).
should
.
exist?
end
it
"doesn't update the cache if the branch is available"
do
@pod
.
top_specification
.
stubs
(
:source
).
returns
(
:git
=>
fixture
(
'banana-lib'
),
:branch
=>
'master'
)
downloader
=
Downloader
.
for_pod
(
@pod
)
downloader
.
download
@pod
.
root
.
rmtree
downloader
.
expects
(
:update_cache
).
never
downloader
.
download
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