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
611432dd
Unverified
Commit
611432dd
authored
Sep 20, 2016
by
Ben Asher
Committed by
Danielle Tomlinson
Oct 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added specs
parent
7ff2b8ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+50
-0
No files found.
spec/unit/installer/analyzer_spec.rb
View file @
611432dd
...
@@ -88,6 +88,7 @@ module Pod
...
@@ -88,6 +88,7 @@ module Pod
FileUtils
.
mkdir_p
(
tmp_directory
)
FileUtils
.
mkdir_p
(
tmp_directory
)
FileUtils
.
cp_r
(
ROOT
+
'spec/fixtures/spec-repos/test_repo/'
,
tmp_directory
)
FileUtils
.
cp_r
(
ROOT
+
'spec/fixtures/spec-repos/test_repo/'
,
tmp_directory
)
non_git_repo
=
tmp_directory
+
'test_repo'
non_git_repo
=
tmp_directory
+
'test_repo'
FileUtils
.
rm
(
non_git_repo
+
'.git'
)
podfile
=
Podfile
.
new
do
podfile
=
Podfile
.
new
do
platform
:ios
,
'8.0'
platform
:ios
,
'8.0'
...
@@ -661,6 +662,55 @@ module Pod
...
@@ -661,6 +662,55 @@ module Pod
should
.
raise
(
Informative
)
{
analyzer
.
analyze
}
should
.
raise
(
Informative
)
{
analyzer
.
analyze
}
end
end
it
'raises when targets integrate the same swift pod but have different swift versions'
do
podfile
=
Podfile
.
new
do
source
SpecHelper
.
test_repo_url
project
'SampleProject/SampleProject'
platform
:ios
,
'8.0'
pod
'OrangeFramework'
target
'SampleProject'
target
'TestRunner'
end
podfile
.
target_definitions
[
'SampleProject'
].
stubs
(
:swift_version
).
returns
(
'3.0'
)
podfile
.
target_definitions
[
'TestRunner'
].
stubs
(
:swift_version
).
returns
(
'2.3'
)
analyzer
=
Pod
::
Installer
::
Analyzer
.
new
(
config
.
sandbox
,
podfile
)
should
.
raise
Informative
do
analyzer
.
analyze
end
.
message
.
should
.
match
/The following pods are integrated into Swift targets that do not have the same Swift version:/
end
it
'does not raise when targets integrate the same pod but only one of the targets is a swift target'
do
podfile
=
Podfile
.
new
do
source
SpecHelper
.
test_repo_url
project
'SampleProject/SampleProject'
platform
:ios
,
'8.0'
pod
'OrangeFramework'
target
'SampleProject'
target
'TestRunner'
end
podfile
.
target_definitions
[
'SampleProject'
].
stubs
(
:swift_version
).
returns
(
'3.0'
)
# when the swift version is unset at the project level, but set in one target, swift_version is nil
podfile
.
target_definitions
[
'TestRunner'
].
stubs
(
:swift_version
).
returns
(
nil
)
analyzer
=
Pod
::
Installer
::
Analyzer
.
new
(
config
.
sandbox
,
podfile
)
lambda
{
analyzer
.
analyze
}.
should
.
not
.
raise
end
it
'does not raise when swift targets with different swift versions integrate a non-swift pod'
do
podfile
=
Podfile
.
new
do
source
SpecHelper
.
test_repo_url
project
'SampleProject/SampleProject'
platform
:ios
,
'8.0'
pod
'JSONKit'
target
'SampleProject'
target
'TestRunner'
end
podfile
.
target_definitions
[
'SampleProject'
].
stubs
(
:swift_version
).
returns
(
'3.0'
)
# when the swift version is set at the project level, but unset in one target, swift_version is empty
podfile
.
target_definitions
[
'TestRunner'
].
stubs
(
:swift_version
).
returns
(
''
)
analyzer
=
Pod
::
Installer
::
Analyzer
.
new
(
config
.
sandbox
,
podfile
)
lambda
{
analyzer
.
analyze
}.
should
.
not
.
raise
end
#--------------------------------------#
#--------------------------------------#
it
'computes the state of the Sandbox respect to the resolved dependencies'
do
it
'computes the state of the Sandbox respect to the resolved dependencies'
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