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
024fa9bc
Commit
024fa9bc
authored
Oct 27, 2015
by
Muhammed Yavuz Nuzumlali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for search index updating during repo updates
parent
f675cf22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
sources_manager_spec.rb
spec/unit/sources_manager_spec.rb
+26
-1
No files found.
spec/unit/sources_manager_spec.rb
View file @
024fa9bc
...
@@ -225,8 +225,9 @@ module Pod
...
@@ -225,8 +225,9 @@ module Pod
describe
'Updating Sources'
do
describe
'Updating Sources'
do
extend
SpecHelper
::
TemporaryRepos
extend
SpecHelper
::
TemporaryRepos
it
'update source backed by a git repository'
do
it
'update
s
source backed by a git repository'
do
set_up_test_repo_for_update
set_up_test_repo_for_update
SourcesManager
.
expects
(
:update_search_index_if_needed_in_background
).
with
({}).
returns
(
nil
)
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
UI
.
output
.
should
.
match
/is up to date/
UI
.
output
.
should
.
match
/is up to date/
end
end
...
@@ -237,10 +238,34 @@ module Pod
...
@@ -237,10 +238,34 @@ module Pod
Dir
.
chdir
(
test_repo_path
)
do
Dir
.
chdir
(
test_repo_path
)
do
`git remote set-url origin file:///dev/null`
`git remote set-url origin file:///dev/null`
end
end
SourcesManager
.
expects
(
:update_search_index_if_needed_in_background
).
with
({}).
returns
(
nil
)
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
SourcesManager
.
update
(
test_repo_path
.
basename
.
to_s
,
true
)
UI
.
warnings
.
should
.
include
(
'not able to update the `master` repo'
)
UI
.
warnings
.
should
.
include
(
'not able to update the `master` repo'
)
end
end
it
'updates search index for changed paths if source is updated'
do
prev_index
=
{
@test_source
.
name
=>
{}}
SourcesManager
.
expects
(
:stored_search_index
).
returns
(
prev_index
)
SourcesManager
.
expects
(
:save_search_index
).
with
()
{
|
value
|
value
[
@test_source
.
name
][
'BananaLib'
].
should
.
include
(
:BananaLib
)
value
[
@test_source
.
name
][
'JSONKit'
].
should
.
include
(
:JSONKit
)
}
changed_paths
=
{
@test_source
=>
%w(BananaLib/1.0/BananaLib.podspec JSONKit/1.4/JSONKit.podspec)
}
SourcesManager
.
update_search_index_if_needed
(
changed_paths
)
end
it
'does not update search index if it does not contain source even if there are changes in source'
do
prev_index
=
{}
SourcesManager
.
expects
(
:stored_search_index
).
returns
(
prev_index
)
SourcesManager
.
expects
(
:save_search_index
).
with
()
{
|
value
|
value
[
@test_source
.
name
].
should
.
be
.
nil
}
changed_paths
=
{
@test_source
=>
%w(BananaLib/1.0/BananaLib.podspec JSONKit/1.4/JSONKit.podspec)
}
SourcesManager
.
update_search_index_if_needed
(
changed_paths
)
end
it
'returns whether a source is backed by a git repo'
do
it
'returns whether a source is backed by a git repo'
do
SourcesManager
.
git_repo?
(
SourcesManager
.
master_repo_dir
).
should
.
be
.
true
SourcesManager
.
git_repo?
(
SourcesManager
.
master_repo_dir
).
should
.
be
.
true
SourcesManager
.
git_repo?
(
Pathname
.
new
(
'/tmp'
)).
should
.
be
.
false
SourcesManager
.
git_repo?
(
Pathname
.
new
(
'/tmp'
)).
should
.
be
.
false
...
...
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