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
867d055b
Commit
867d055b
authored
Apr 05, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix validator specs
parent
f97108e5
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
30 deletions
+31
-30
installer.rb
lib/cocoapods/installer.rb
+0
-2
sandbox.rb
lib/cocoapods/sandbox.rb
+2
-1
push_spec.rb
spec/functional/command/repo/push_spec.rb
+8
-8
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+1
-0
sandbox_spec.rb
spec/unit/sandbox_spec.rb
+1
-6
validator_spec.rb
spec/unit/validator_spec.rb
+19
-13
No files found.
lib/cocoapods/installer.rb
View file @
867d055b
...
@@ -687,8 +687,6 @@ module Pod
...
@@ -687,8 +687,6 @@ module Pod
raise
Pod
::
Informative
,
'The `Pods` directory is out-of-date, you must run `pod install`'
raise
Pod
::
Informative
,
'The `Pods` directory is out-of-date, you must run `pod install`'
end
end
create_file_accessors
aggregate_targets
aggregate_targets
end
end
end
end
...
...
lib/cocoapods/sandbox.rb
View file @
867d055b
...
@@ -261,9 +261,10 @@ module Pod
...
@@ -261,9 +261,10 @@ module Pod
unless
podspec
.
exist?
unless
podspec
.
exist?
raise
Informative
,
"No podspec found for `
#{
name
}
` in
#{
podspec
}
"
raise
Informative
,
"No podspec found for `
#{
name
}
` in
#{
podspec
}
"
end
end
spec
=
Specification
.
from_file
(
podspec
)
FileUtils
.
copy
(
podspec
,
output_path
)
FileUtils
.
copy
(
podspec
,
output_path
)
when
Specification
when
Specification
raise
ArgumentError
unless
json
raise
ArgumentError
,
"can only store Specification objects as json"
unless
json
output_path
.
open
(
'w'
)
{
|
f
|
f
.
puts
(
podspec
.
to_pretty_json
)
}
output_path
.
open
(
'w'
)
{
|
f
|
f
.
puts
(
podspec
.
to_pretty_json
)
}
spec
=
podspec
.
dup
spec
=
podspec
.
dup
else
else
...
...
spec/functional/command/repo/push_spec.rb
View file @
867d055b
...
@@ -185,10 +185,10 @@ module Pod
...
@@ -185,10 +185,10 @@ module Pod
end
end
it
'validates specs as frameworks by default'
do
it
'validates specs as frameworks by default'
do
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
'8.0'
,
true
,
[]).
times
(
3
)
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
'8.0'
,
true
,
[]).
times
(
3
)
.
returns
(
stub
(
'Podfile'
))
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:osx
,
nil
,
true
,
[]).
twice
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:osx
,
nil
,
true
,
[]).
twice
.
returns
(
stub
(
'Podfile'
))
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:watchos
,
nil
,
true
,
[]).
twice
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:watchos
,
nil
,
true
,
[]).
twice
.
returns
(
stub
(
'Podfile'
))
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:tvos
,
nil
,
true
,
[]).
twice
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:tvos
,
nil
,
true
,
[]).
twice
.
returns
(
stub
(
'Podfile'
))
cmd
=
command
(
'repo'
,
'push'
,
'master'
)
cmd
=
command
(
'repo'
,
'push'
,
'master'
)
# Git push will throw an exception here since this is a local custom git repo. All we care is the validator
# Git push will throw an exception here since this is a local custom git repo. All we care is the validator
...
@@ -199,10 +199,10 @@ module Pod
...
@@ -199,10 +199,10 @@ module Pod
end
end
it
'validates specs as libraries if requested'
do
it
'validates specs as libraries if requested'
do
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
nil
,
false
,
[]).
times
(
3
)
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
nil
,
false
,
[]).
times
(
3
)
.
returns
(
stub
(
'Podfile'
))
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:osx
,
nil
,
false
,
[]).
twice
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:osx
,
nil
,
false
,
[]).
twice
.
returns
(
stub
(
'Podfile'
))
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:watchos
,
nil
,
false
,
[]).
twice
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:watchos
,
nil
,
false
,
[]).
twice
.
returns
(
stub
(
'Podfile'
))
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:tvos
,
nil
,
false
,
[]).
twice
Validator
.
any_instance
.
expects
(
:podfile_from_spec
).
with
(
:tvos
,
nil
,
false
,
[]).
twice
.
returns
(
stub
(
'Podfile'
))
cmd
=
command
(
'repo'
,
'push'
,
'master'
,
'--use-libraries'
)
cmd
=
command
(
'repo'
,
'push'
,
'master'
,
'--use-libraries'
)
# Git push will throw an exception here since this is a local custom git repo. All we care is the validator
# Git push will throw an exception here since this is a local custom git repo. All we care is the validator
...
...
spec/unit/installer/analyzer_spec.rb
View file @
867d055b
...
@@ -1040,6 +1040,7 @@ module Pod
...
@@ -1040,6 +1040,7 @@ module Pod
@sandbox_manifest
=
Pod
::
Lockfile
.
new
(
@lockfile
.
internal_data
.
deep_dup
)
@sandbox_manifest
=
Pod
::
Lockfile
.
new
(
@lockfile
.
internal_data
.
deep_dup
)
@analyzer
.
sandbox
.
manifest
=
@sandbox_manifest
@analyzer
.
sandbox
.
manifest
=
@sandbox_manifest
@analyzer
.
sandbox
.
stubs
(
:specification
).
with
(
'BananaLib'
).
returns
(
stub
)
@analyzer
.
sandbox
.
stubs
(
:specification
).
with
(
'BananaLib'
).
returns
(
stub
)
@analyzer
.
sandbox
.
stubs
(
:specification_path
).
with
(
'BananaLib'
).
returns
(
stub
)
pod_dir
=
stub
pod_dir
=
stub
pod_dir
.
stubs
(
:directory?
).
returns
(
true
)
pod_dir
.
stubs
(
:directory?
).
returns
(
true
)
@analyzer
.
sandbox
.
stubs
(
:pod_dir
).
with
(
'BananaLib'
).
returns
(
pod_dir
)
@analyzer
.
sandbox
.
stubs
(
:pod_dir
).
with
(
'BananaLib'
).
returns
(
pod_dir
)
...
...
spec/unit/sandbox_spec.rb
View file @
867d055b
...
@@ -107,13 +107,8 @@ module Pod
...
@@ -107,13 +107,8 @@ module Pod
it
'loads the stored specification from the original path'
do
it
'loads the stored specification from the original path'
do
spec_file
=
fixture
(
'banana-lib/BananaLib.podspec'
)
spec_file
=
fixture
(
'banana-lib/BananaLib.podspec'
)
spec
=
Specification
.
from_file
(
spec_file
)
spec
=
Specification
.
from_file
(
spec_file
)
Specification
.
expects
(
:from_file
).
with
do
Dir
.
pwd
==
fixture
(
'banana-lib'
).
to_s
end
.
once
.
returns
(
spec
)
Specification
.
expects
(
:from_file
).
with
do
|
path
|
Specification
.
expects
(
:from_file
).
with
(
spec_file
).
once
.
returns
(
spec
)
path
==
spec_file
end
.
once
.
returns
(
spec
)
@sandbox
.
store_podspec
(
'BananaLib'
,
spec_file
)
@sandbox
.
store_podspec
(
'BananaLib'
,
spec_file
)
@sandbox
.
store_local_path
(
'BananaLib'
,
spec_file
)
@sandbox
.
store_local_path
(
'BananaLib'
,
spec_file
)
...
...
spec/unit/validator_spec.rb
View file @
867d055b
...
@@ -360,12 +360,14 @@ module Pod
...
@@ -360,12 +360,14 @@ module Pod
s
.
ios
.
deployment_target
=
'7.0'
s
.
ios
.
deployment_target
=
'7.0'
end
end
validator
.
spec
.
stubs
(
:subspecs
).
returns
([
subspec
])
validator
.
spec
.
stubs
(
:subspecs
).
returns
([
subspec
])
validator
.
expects
(
:podfile_from_spec
).
with
(
:osx
,
nil
,
nil
,
[]).
once
validator
.
expects
(
:podfile_from_spec
).
with
(
:osx
,
nil
,
nil
,
[]).
once
.
returns
(
stub
(
'Podfile'
))
validator
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
nil
,
nil
,
[]).
once
validator
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
nil
,
nil
,
[]).
once
.
returns
(
stub
(
'Podfile'
))
validator
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
'7.0'
,
nil
,
[]).
once
validator
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
'7.0'
,
nil
,
[]).
once
.
returns
(
stub
(
'Podfile'
))
validator
.
expects
(
:podfile_from_spec
).
with
(
:tvos
,
nil
,
nil
,
[]).
once
validator
.
expects
(
:podfile_from_spec
).
with
(
:tvos
,
nil
,
nil
,
[]).
once
.
returns
(
stub
(
'Podfile'
))
validator
.
expects
(
:podfile_from_spec
).
with
(
:watchos
,
nil
,
nil
,
[]).
once
validator
.
expects
(
:podfile_from_spec
).
with
(
:watchos
,
nil
,
nil
,
[]).
once
.
returns
(
stub
(
'Podfile'
))
validator
.
send
(
:perform_extensive_analysis
,
validator
.
spec
)
validator
.
send
(
:perform_extensive_analysis
,
validator
.
spec
)
validator
.
results_message
.
strip
.
should
.
be
.
empty
end
end
describe
'#podfile_from_spec'
do
describe
'#podfile_from_spec'
do
...
@@ -799,11 +801,13 @@ module Pod
...
@@ -799,11 +801,13 @@ module Pod
setup_validator
setup_validator
@validator
.
expects
(
:podfile_from_spec
).
with
(
:osx
,
nil
,
true
,
[]).
once
@validator
.
expects
(
:podfile_from_spec
).
with
(
:osx
,
nil
,
true
,
[]).
once
.
returns
(
stub
(
'Podfile'
))
@validator
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
'8.0'
,
true
,
[]).
once
@validator
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
'8.0'
,
true
,
[]).
once
.
returns
(
stub
(
'Podfile'
))
@validator
.
expects
(
:podfile_from_spec
).
with
(
:tvos
,
nil
,
true
,
[]).
once
@validator
.
expects
(
:podfile_from_spec
).
with
(
:tvos
,
nil
,
true
,
[]).
once
.
returns
(
stub
(
'Podfile'
))
@validator
.
expects
(
:podfile_from_spec
).
with
(
:watchos
,
nil
,
true
,
[]).
once
@validator
.
expects
(
:podfile_from_spec
).
with
(
:watchos
,
nil
,
true
,
[]).
once
.
returns
(
stub
(
'Podfile'
))
@validator
.
send
(
:perform_extensive_analysis
,
@validator
.
spec
)
@validator
.
send
(
:perform_extensive_analysis
,
@validator
.
spec
)
@validator
.
results_message
.
strip
.
should
.
be
.
empty
end
end
it
'lint as a static library if specified'
do
it
'lint as a static library if specified'
do
...
@@ -811,11 +815,13 @@ module Pod
...
@@ -811,11 +815,13 @@ module Pod
setup_validator
setup_validator
@validator
.
expects
(
:podfile_from_spec
).
with
(
:osx
,
nil
,
false
,
[]).
once
@validator
.
expects
(
:podfile_from_spec
).
with
(
:osx
,
nil
,
false
,
[]).
once
.
returns
(
stub
(
'Podfile'
))
@validator
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
nil
,
false
,
[]).
once
@validator
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
nil
,
false
,
[]).
once
.
returns
(
stub
(
'Podfile'
))
@validator
.
expects
(
:podfile_from_spec
).
with
(
:tvos
,
nil
,
false
,
[]).
once
@validator
.
expects
(
:podfile_from_spec
).
with
(
:tvos
,
nil
,
false
,
[]).
once
.
returns
(
stub
(
'Podfile'
))
@validator
.
expects
(
:podfile_from_spec
).
with
(
:watchos
,
nil
,
false
,
[]).
once
@validator
.
expects
(
:podfile_from_spec
).
with
(
:watchos
,
nil
,
false
,
[]).
once
.
returns
(
stub
(
'Podfile'
))
@validator
.
send
(
:perform_extensive_analysis
,
@validator
.
spec
)
@validator
.
send
(
:perform_extensive_analysis
,
@validator
.
spec
)
@validator
.
results_message
.
strip
.
should
.
be
.
empty
end
end
it
'shows an error when performing extensive analysis on a test spec'
do
it
'shows an error when performing extensive analysis on a test spec'
do
...
...
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