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
fe461952
Commit
fe461952
authored
May 16, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Specs] Minor clean up and cosmetic fixes.
parent
9323fbac
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
118 additions
and
120 deletions
+118
-120
install_spec.rb
spec/functional/command/install_spec.rb
+9
-1
integration_spec.rb
spec/integration_spec.rb
+2
-2
command_spec.rb
spec/unit/command_spec.rb
+0
-9
installer_spec.rb
spec/unit/installer_spec.rb
+2
-5
platform_spec.rb
spec/unit/platform_spec.rb
+104
-102
podfile_spec.rb
spec/unit/podfile_spec.rb
+1
-1
No files found.
spec/
unit/command/install_command
_spec.rb
→
spec/
functional/command/install
_spec.rb
View file @
fe461952
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
"Pod::Command::Install"
do
describe
"Pod::Command::Install"
do
extend
SpecHelper
::
Command
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
it
"should include instructions on how to reference the xcode project"
do
it
"should include instructions on how to reference the xcode project"
do
Pod
::
Command
::
Install
.
banner
.
should
.
match
%r{xcodeproj 'path/to/XcodeProject'}
Pod
::
Command
::
Install
.
banner
.
should
.
match
%r{xcodeproj 'path/to/XcodeProject'}
end
end
end
it
"tells the user that no Podfile or podspec was found in the current working dir"
do
exception
=
lambda
{
run_command
(
'install'
,
'--no-update'
)
}.
should
.
raise
Pod
::
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the current working directory."
end
end
spec/integration_spec.rb
View file @
fe461952
...
@@ -69,7 +69,7 @@ else
...
@@ -69,7 +69,7 @@ else
target
=
target_definition
target
=
target_definition
with_xcodebuild_available
do
with_xcodebuild_available
do
Dir
.
chdir
(
config
.
project_pods_root
)
do
Dir
.
chdir
(
config
.
project_pods_root
)
do
p
uts
"
\n
[!] Compiling
#{
target
.
label
}
static library...
"
p
rint
"[!] Compiling
#{
target
.
label
}
...
\r
"
should_successfully_perform
"xcodebuild -target '
#{
target
.
label
}
'"
should_successfully_perform
"xcodebuild -target '
#{
target
.
label
}
'"
lib_path
=
config
.
project_pods_root
+
"build/Release
#{
'-iphoneos'
if
target
.
platform
==
:ios
}
"
+
target
.
lib_name
lib_path
=
config
.
project_pods_root
+
"build/Release
#{
'-iphoneos'
if
target
.
platform
==
:ios
}
"
+
target
.
lib_name
`lipo -info '
#{
lib_path
}
'`
.
should
.
include
"architecture:
#{
target
.
platform
==
:ios
?
'armv7'
:
'x86_64'
}
"
`lipo -info '
#{
lib_path
}
'`
.
should
.
include
"architecture:
#{
target
.
platform
==
:ios
?
'armv7'
:
'x86_64'
}
"
...
@@ -117,7 +117,7 @@ else
...
@@ -117,7 +117,7 @@ else
}
}
end
end
it
"install a dummy source file"
do
it
"install
s
a dummy source file"
do
create_config!
create_config!
podfile
=
Pod
::
Podfile
.
new
do
podfile
=
Pod
::
Podfile
.
new
do
self
.
platform
:ios
self
.
platform
:ios
...
...
spec/unit/command_spec.rb
View file @
fe461952
...
@@ -15,12 +15,3 @@ describe "Pod::Command::Repo" do
...
@@ -15,12 +15,3 @@ describe "Pod::Command::Repo" do
end
end
end
end
describe
"Pod::Command::Install"
do
it
"tells the user that no Podfile or podspec was found in the current working dir"
do
command
=
Pod
::
Command
::
Install
.
new
(
argv
)
exception
=
lambda
{
command
.
run
}.
should
.
raise
Pod
::
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the current working directory."
end
end
spec/unit/installer_spec.rb
View file @
fe461952
...
@@ -2,18 +2,15 @@ require File.expand_path('../../spec_helper', __FILE__)
...
@@ -2,18 +2,15 @@ require File.expand_path('../../spec_helper', __FILE__)
describe
"Pod::Installer"
do
describe
"Pod::Installer"
do
before
do
before
do
@config_before
=
config
Pod
::
Config
.
instance
=
nil
config
.
silent
=
true
config
.
repos_dir
=
fixture
(
'spec-repos'
)
config
.
repos_dir
=
fixture
(
'spec-repos'
)
config
.
project_pods_root
=
fixture
(
'integration'
)
config
.
project_pods_root
=
fixture
(
'integration'
)
end
end
after
do
after
do
Pod
::
Config
.
instance
=
@config_before
config
.
repos_dir
=
SpecHelper
.
tmp_repos_path
end
end
describe
"
, by default,
"
do
describe
"
by default
"
do
before
do
before
do
podfile
=
Pod
::
Podfile
.
new
do
podfile
=
Pod
::
Podfile
.
new
do
platform
:ios
platform
:ios
...
...
spec/unit/platform_spec.rb
View file @
fe461952
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
describe
Pod
::
Platform
do
describe
Pod
::
Platform
do
it
"returns a new Platform instance"
do
describe
"by default"
do
Pod
::
Platform
.
ios
.
should
==
Pod
::
Platform
.
new
(
:ios
)
it
"returns a new Platform instance"
do
Pod
::
Platform
.
osx
.
should
==
Pod
::
Platform
.
new
(
:osx
)
Pod
::
Platform
.
ios
.
should
==
Pod
::
Platform
.
new
(
:ios
)
end
Pod
::
Platform
.
osx
.
should
==
Pod
::
Platform
.
new
(
:osx
)
end
before
do
@platform
=
Pod
::
Platform
.
ios
before
do
end
@platform
=
Pod
::
Platform
.
ios
end
it
"exposes it's symbolic name"
do
@platform
.
name
.
should
==
:ios
it
"exposes it's symbolic name"
do
end
@platform
.
name
.
should
==
:ios
end
it
"can be compared for equality with another platform with the same symbolic name"
do
@platform
.
should
==
Pod
::
Platform
.
new
(
:ios
)
it
"can be compared for equality with another platform with the same symbolic name"
do
end
@platform
.
should
==
Pod
::
Platform
.
new
(
:ios
)
end
it
"can be compared for equality with another platform with the same symbolic name and the same deployment target"
do
@platform
.
should
.
not
==
Pod
::
Platform
.
new
(
:ios
,
'4.0'
)
it
"can be compared for equality with another platform with the same symbolic name and the same deployment target"
do
Pod
::
Platform
.
new
(
:ios
,
'4.0'
).
should
==
Pod
::
Platform
.
new
(
:ios
,
'4.0'
)
@platform
.
should
.
not
==
Pod
::
Platform
.
new
(
:ios
,
'4.0'
)
end
Pod
::
Platform
.
new
(
:ios
,
'4.0'
).
should
==
Pod
::
Platform
.
new
(
:ios
,
'4.0'
)
end
it
"can be compared for equality with a matching symbolic name (backwards compatibility reasons)"
do
@platform
.
should
==
:ios
it
"can be compared for equality with a matching symbolic name (backwards compatibility reasons)"
do
end
@platform
.
should
==
:ios
end
it
"presents an accurate string representation"
do
@platform
.
to_s
.
should
==
"iOS"
it
"presents an accurate string representation"
do
Pod
::
Platform
.
new
(
:osx
).
to_s
.
should
==
'OS X'
@platform
.
to_s
.
should
==
"iOS"
Pod
::
Platform
.
new
(
nil
).
to_s
.
should
==
"iOS - OS X"
Pod
::
Platform
.
new
(
:osx
).
to_s
.
should
==
'OS X'
Pod
::
Platform
.
new
(
:ios
,
'5.0.0'
).
to_s
.
should
==
'iOS 5.0.0'
Pod
::
Platform
.
new
(
nil
).
to_s
.
should
==
"iOS - OS X"
Pod
::
Platform
.
new
(
:osx
,
'10.7'
).
to_s
.
should
==
'OS X 10.7'
Pod
::
Platform
.
new
(
:ios
,
'5.0.0'
).
to_s
.
should
==
'iOS 5.0.0'
end
Pod
::
Platform
.
new
(
:osx
,
'10.7'
).
to_s
.
should
==
'OS X 10.7'
end
it
"uses it's name as it's symbold version"
do
@platform
.
to_sym
.
should
==
:ios
it
"uses it's name as it's symbold version"
do
end
@platform
.
to_sym
.
should
==
:ios
end
it
"allows to specify the deployment target on initialization"
do
p
=
Pod
::
Platform
.
new
(
:ios
,
'4.0.0'
)
it
"allows to specify the deployment target on initialization"
do
p
.
deployment_target
.
should
==
Pod
::
Version
.
new
(
'4.0.0'
)
p
=
Pod
::
Platform
.
new
(
:ios
,
'4.0.0'
)
end
p
.
deployment_target
.
should
==
Pod
::
Version
.
new
(
'4.0.0'
)
end
it
"allows to specify the deployment target in a hash on initialization (backwards compatibility from 0.6)"
do
p
=
Pod
::
Platform
.
new
(
:ios
,
{
:deployment_target
=>
'4.0.0'
})
it
"allows to specify the deployment target in a hash on initialization (backwards compatibility from 0.6)"
do
p
.
deployment_target
.
should
==
Pod
::
Version
.
new
(
'4.0.0'
)
p
=
Pod
::
Platform
.
new
(
:ios
,
{
:deployment_target
=>
'4.0.0'
})
end
p
.
deployment_target
.
should
==
Pod
::
Version
.
new
(
'4.0.0'
)
end
it
"allows to specify the deployment target after initialization"
do
p
=
Pod
::
Platform
.
new
(
:ios
,
'4.0.0'
)
it
"allows to specify the deployment target after initialization"
do
p
.
deployment_target
=
'4.0.0'
p
=
Pod
::
Platform
.
new
(
:ios
,
'4.0.0'
)
p
.
deployment_target
.
should
==
Pod
::
Version
.
new
(
'4.0.0'
)
p
.
deployment_target
=
'4.0.0'
p
.
deployment_target
=
Pod
::
Version
.
new
(
'4.0.0'
)
p
.
deployment_target
.
should
==
Pod
::
Version
.
new
(
'4.0.0'
)
p
.
deployment_target
.
should
==
Pod
::
Version
.
new
(
'4.0.0'
)
p
.
deployment_target
=
Pod
::
Version
.
new
(
'4.0.0'
)
end
p
.
deployment_target
.
should
==
Pod
::
Version
.
new
(
'4.0.0'
)
end
end
end
describe
"Pod::Platform with a nil value"
do
before
do
describe
"with a nil value"
do
@platform
=
Pod
::
Platform
.
new
(
nil
)
before
do
end
@platform
=
Pod
::
Platform
.
new
(
nil
)
end
it
"behaves like a nil object"
do
@platform
.
should
.
be
.
nil
it
"behaves like a nil object"
do
end
@platform
.
should
.
be
.
nil
end
end
end
describe
"Pod::Platform#supports?"
do
it
"supports another platform is with the same operating system"
do
describe
"regarding supporting platforms"
do
p1
=
Pod
::
Platform
.
new
(
:ios
)
it
"supports platforms with the same operating system"
do
p2
=
Pod
::
Platform
.
new
(
:ios
)
p1
=
Pod
::
Platform
.
new
(
:ios
)
p1
.
should
.
supports?
(
p2
)
p2
=
Pod
::
Platform
.
new
(
:ios
)
p1
.
should
.
supports?
(
p2
)
p1
=
Pod
::
Platform
.
new
(
:osx
)
p2
=
Pod
::
Platform
.
new
(
:osx
)
p1
=
Pod
::
Platform
.
new
(
:osx
)
p1
.
should
.
supports?
(
p2
)
p2
=
Pod
::
Platform
.
new
(
:osx
)
end
p1
.
should
.
supports?
(
p2
)
end
it
"supports a nil platform"
do
p1
=
Pod
::
Platform
.
new
(
:ios
)
it
"supports a nil platform"
do
p1
.
should
.
supports?
(
nil
)
p1
=
Pod
::
Platform
.
new
(
:ios
)
end
p1
.
should
.
supports?
(
nil
)
end
it
"supports a platform with a lower or equal deployment_target"
do
p1
=
Pod
::
Platform
.
new
(
:ios
,
'5.0'
)
it
"supports a platform with a lower or equal deployment_target"
do
p2
=
Pod
::
Platform
.
new
(
:ios
,
'4.0'
)
p1
=
Pod
::
Platform
.
new
(
:ios
,
'5.0'
)
p1
.
should
.
supports?
(
p1
)
p2
=
Pod
::
Platform
.
new
(
:ios
,
'4.0'
)
p1
.
should
.
supports?
(
p2
)
p1
.
should
.
supports?
(
p1
)
p2
.
should
.
not
.
supports?
(
p1
)
p1
.
should
.
supports?
(
p2
)
end
p2
.
should
.
not
.
supports?
(
p1
)
end
it
"supports a platform regardless of the deployment_target if one of the two does not specify it"
do
p1
=
Pod
::
Platform
.
new
(
:ios
)
it
"supports a platform regardless of the deployment_target if one of the two does not specify it"
do
p2
=
Pod
::
Platform
.
new
(
:ios
,
'4.0'
)
p1
=
Pod
::
Platform
.
new
(
:ios
)
p1
.
should
.
supports?
(
p2
)
p2
=
Pod
::
Platform
.
new
(
:ios
,
'4.0'
)
p2
.
should
.
supports?
(
p1
)
p1
.
should
.
supports?
(
p2
)
end
p2
.
should
.
supports?
(
p1
)
end
it
"doesn't supports a platform with a different operating system"
do
p1
=
Pod
::
Platform
.
new
(
:ios
)
it
"doesn't supports a platform with a different operating system"
do
p2
=
Pod
::
Platform
.
new
(
:osx
)
p1
=
Pod
::
Platform
.
new
(
:ios
)
p1
.
should
.
not
.
supports?
(
p2
)
p2
=
Pod
::
Platform
.
new
(
:osx
)
p1
.
should
.
not
.
supports?
(
p2
)
end
end
end
end
end
spec/unit/podfile_spec.rb
View file @
fe461952
...
@@ -25,7 +25,7 @@ describe "Pod::Podfile" do
...
@@ -25,7 +25,7 @@ describe "Pod::Podfile" do
dep
=
podfile
.
dependency_by_top_level_spec_name
(
'SomeExternalPod'
)
dep
=
podfile
.
dependency_by_top_level_spec_name
(
'SomeExternalPod'
)
dep
.
external_source
.
params
.
should
==
{
:git
=>
'GIT-URL'
,
:commit
=>
'1234'
}
dep
.
external_source
.
params
.
should
==
{
:git
=>
'GIT-URL'
,
:commit
=>
'1234'
}
end
end
it
"adds a subspec dependency on a Pod repo outside of a spec repo (the repo is expected to contain a podspec)"
do
it
"adds a subspec dependency on a Pod repo outside of a spec repo (the repo is expected to contain a podspec)"
do
podfile
=
Pod
::
Podfile
.
new
do
podfile
=
Pod
::
Podfile
.
new
do
dependency
'MainSpec/FirstSubSpec'
,
:git
=>
'GIT-URL'
,
:commit
=>
'1234'
dependency
'MainSpec/FirstSubSpec'
,
:git
=>
'GIT-URL'
,
:commit
=>
'1234'
...
...
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