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
044b4a4c
Unverified
Commit
044b4a4c
authored
Sep 25, 2016
by
Danielle Tomlinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Validator] Inform people of .swift-version on failure.
parent
93e847fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
validator.rb
lib/cocoapods/validator.rb
+6
-1
validator_spec.rb
spec/unit/validator_spec.rb
+13
-0
No files found.
lib/cocoapods/validator.rb
View file @
044b4a4c
...
@@ -142,7 +142,12 @@ module Pod
...
@@ -142,7 +142,12 @@ module Pod
reasons
<<
'all results apply only to public specs, but you can use '
\
reasons
<<
'all results apply only to public specs, but you can use '
\
'`--private` to ignore them if linting the specification for a private pod'
'`--private` to ignore them if linting the specification for a private pod'
end
end
reasons
.
to_sentence
if
dot_swift_version
.
nil?
reasons
.
to_sentence
+
".
\n
[!] If you are trying to validate a Swift 3.0 Pod, "
\
'you need to have a `.swift-version` file. e.g `echo "3.0" > .swift-version`'
else
reasons
.
to_sentence
end
end
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
...
...
spec/unit/validator_spec.rb
View file @
044b4a4c
...
@@ -812,6 +812,19 @@ module Pod
...
@@ -812,6 +812,19 @@ module Pod
validator
.
results
.
count
.
should
==
0
validator
.
results
.
count
.
should
==
0
end
end
it
'tells users about the .swift-version file if the validation fails'
do
Specification
.
any_instance
.
stubs
(
:deployment_target
).
returns
(
'9.0'
)
validator
=
test_swiftpod
validator
.
stubs
(
:validated?
).
returns
(
false
)
result
=
Validator
::
Result
.
new
(
:error
,
'attribute'
,
'message'
)
validator
.
stubs
(
:results
).
returns
([
result
])
validator
.
failure_reason
.
should
==
"1 error.
\n
[!] If you are trying"
\
' to validate a Swift 3.0 Pod, you need to have a `.swift-version` '
\
'file. e.g `echo "3.0" > .swift-version`'
end
describe
'#swift_version'
do
describe
'#swift_version'
do
it
'defaults to Swift 2.3'
do
it
'defaults to Swift 2.3'
do
validator
=
test_swiftpod
validator
=
test_swiftpod
...
...
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