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
49d0fe8a
Unverified
Commit
49d0fe8a
authored
Sep 11, 2016
by
Danielle Tomlinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Validator] Use Pathname instead of File
parent
b088c4c0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
validator.rb
lib/cocoapods/validator.rb
+1
-1
validator_spec.rb
spec/unit/validator_spec.rb
+3
-7
No files found.
lib/cocoapods/validator.rb
View file @
49d0fe8a
...
...
@@ -247,7 +247,7 @@ module Pod
#
def
dot_swift_version
swift_version_path
=
file
.
dirname
+
'.swift-version'
File
.
read
(
swift_version_path
)
if
File
.
exist?
(
swift_version_path
)
swift_version_path
.
read
if
swift_version_path
.
exist?
end
#-------------------------------------------------------------------------#
...
...
spec/unit/validator_spec.rb
View file @
49d0fe8a
...
...
@@ -835,18 +835,14 @@ module Pod
describe
'#dot_swift_version'
do
it
'looks for a .swift-version file'
do
validator
=
test_swiftpod
File
.
expects
(
:exist?
).
with
do
|
arg
|
arg
.
basename
.
to_s
==
'.swift-version'
end
Pathname
.
any_instance
.
expects
(
:exist?
)
validator
.
dot_swift_version
end
it
'uses the .swift-version file if present'
do
validator
=
test_swiftpod
File
.
stubs
(
:exist?
).
returns
(
true
)
File
.
expects
(
:read
).
with
do
|
arg
|
arg
.
basename
.
to_s
==
'.swift-version'
end
.
returns
(
'1.0'
)
Pathname
.
any_instance
.
stubs
(
:exist?
).
returns
(
true
)
Pathname
.
any_instance
.
expects
(
:read
).
returns
(
'1.0'
)
validator
.
dot_swift_version
.
should
==
'1.0'
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