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
a4cd7d5d
Commit
a4cd7d5d
authored
Mar 19, 2017
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix regression from #6457 to ensure a correct error message is given when a spec is not found.
parent
8df7c49a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
CHANGELOG.md
CHANGELOG.md
+4
-0
abstract_external_source.rb
lib/cocoapods/external_sources/abstract_external_source.rb
+3
-1
abstract_external_source_spec.rb
spec/unit/external_sources/abstract_external_source_spec.rb
+10
-4
No files found.
CHANGELOG.md
View file @
a4cd7d5d
...
...
@@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
*
Fix regression from #6457 to ensure a correct error message is given when a spec is not found.
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#6457
](
https://github.com/CocoaPods/CocoaPods/issues/6457
)
*
Provide a better error message if a podspec is found but cannot be parsed.
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#6457
](
https://github.com/CocoaPods/CocoaPods/issues/6457
)
...
...
lib/cocoapods/external_sources/abstract_external_source.rb
View file @
a4cd7d5d
...
...
@@ -116,10 +116,12 @@ module Pod
rescue
Pod
::
DSLError
=>
e
raise
Informative
,
"Failed to load '
#{
name
}
' podspec:
#{
e
.
message
}
"
rescue
=>
_
raise
Informative
,
"
Unable to find a specification for
'
#{
name
}
'."
raise
Informative
,
"
Failed to download
'
#{
name
}
'."
end
spec
=
download_result
.
spec
raise
Informative
,
"Unable to find a specification for '
#{
name
}
'."
unless
spec
store_podspec
(
sandbox
,
spec
)
sandbox
.
store_pre_downloaded_pod
(
name
)
sandbox
.
store_checkout_source
(
name
,
download_result
.
checkout_options
)
...
...
spec/unit/external_sources/abstract_external_source_spec.rb
View file @
a4cd7d5d
...
...
@@ -36,6 +36,12 @@ module Pod
end
end
it
'raises a generic error if pre download fails'
do
Downloader
.
stubs
(
:download
).
raises
(
Pod
::
Downloader
::
DownloaderError
.
new
(
'Some generic exception'
))
exception
=
lambda
{
@subject
.
send
(
:pre_download
,
config
.
sandbox
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"Failed to download 'Reachability'"
end
it
'raises appropriate error if a DSLError when storing a podspec from string'
do
podspec
=
'Pod::Spec.new do |s|; error; end'
should
.
raise
(
Informative
)
{
@subject
.
send
(
:store_podspec
,
config
.
sandbox
,
podspec
)
}.
...
...
@@ -51,10 +57,10 @@ module Pod
end
it
'raises a generic error if a podspec was not found'
do
Downloader
.
stubs
(
:download
).
raises
(
Pod
::
Downloader
::
DownloaderError
.
new
(
'Some generic exception'
)
)
should
.
raise
(
Informative
)
do
@subject
.
send
(
:pre_download
,
config
.
sandbox
).
message
.
should
==
"Unable to find a specification for 'Reachability'."
e
nd
download_result
=
stub
(
:spec
=>
nil
)
Downloader
.
stubs
(
:download
).
returns
(
download_result
)
exception
=
lambda
{
@subject
.
send
(
:pre_download
,
config
.
sandbox
)
}.
should
.
raise
Informative
e
xception
.
message
.
should
.
include
"Unable to find a specification for 'Reachability'."
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