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
c28477f2
Commit
c28477f2
authored
Feb 01, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Spec] Add tests for PodVariant
parent
85530154
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
pod_variant_spec.rb
spec/unit/installer/analyzer/pod_variant_spec.rb
+48
-0
No files found.
spec/unit/installer/analyzer/pod_variant_spec.rb
0 → 100644
View file @
c28477f2
require
File
.
expand_path
(
'../../../../spec_helper'
,
__FILE__
)
module
Pod
describe
PodVariant
=
Installer
::
Analyzer
::
PodVariant
do
before
do
@specs
=
[
stub
(
'Spec'
),
stub
(
'Spec/Foo'
)]
@platform
=
Platform
.
ios
end
it
'can be initialized with specs and platform'
do
variant
=
PodVariant
.
new
(
@specs
,
@platform
)
variant
.
specs
.
should
==
@specs
variant
.
platform
.
should
==
@platform
variant
.
requires_frameworks
.
should
==
false
end
it
'can be initialized with specs, platform and whether it requires frameworks'
do
variant
=
PodVariant
.
new
(
@specs
,
@platform
,
true
)
variant
.
specs
.
should
==
@specs
variant
.
platform
.
should
==
@platform
variant
.
requires_frameworks
.
should
==
true
end
it
'can return the root spec'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
variant
=
PodVariant
.
new
([
spec
],
Platform
.
ios
)
variant
.
root_spec
.
should
==
spec
end
it
'can be compared for equality with another variant with the same specs, platform and value for whether it requires frameworks'
do
spec
=
PodVariant
.
new
(
@specs
,
@platform
,
false
)
spec
.
should
==
PodVariant
.
new
(
@specs
,
@platform
,
false
)
spec
.
should
.
not
==
PodVariant
.
new
([
@specs
.
first
],
@platform
,
false
)
spec
.
should
.
not
==
PodVariant
.
new
(
@specs
,
Platform
.
osx
,
false
)
spec
.
should
.
not
==
PodVariant
.
new
(
@specs
,
@platform
,
true
)
end
it
'can be used as hash keys'
do
k0
=
PodVariant
.
new
(
@specs
,
@platform
,
false
)
v0
=
stub
(
'Value at index 0'
)
k1
=
PodVariant
.
new
(
@specs
,
@platform
,
true
)
v1
=
stub
(
'Value at index 1'
)
hash
=
{
k0
=>
v0
,
k1
=>
v1
}
hash
[
k0
].
should
==
v0
hash
[
k1
].
should
==
v1
end
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