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
0684132b
Commit
0684132b
authored
Jan 03, 2015
by
Kyle Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Gemfile] Update rubocop
parent
8c920151
Show whitespace changes
Inline
Side-by-side
Showing
61 changed files
with
7 additions
and
290 deletions
+7
-290
Gemfile.lock
Gemfile.lock
+7
-7
Rakefile
Rakefile
+0
-2
lib.rb
lib/cocoapods/command/lib.rb
+0
-1
outdated.rb
lib/cocoapods/command/outdated.rb
+0
-2
downloader.rb
lib/cocoapods/downloader.rb
+0
-2
installer.rb
lib/cocoapods/installer.rb
+0
-1
sandbox.rb
lib/cocoapods/sandbox.rb
+0
-2
init_spec.rb
spec/functional/command/init_spec.rb
+0
-1
inter_process_communication_spec.rb
spec/functional/command/inter_process_communication_spec.rb
+0
-12
lib_spec.rb
spec/functional/command/lib_spec.rb
+0
-1
project_spec.rb
spec/functional/command/project_spec.rb
+0
-5
search_spec.rb
spec/functional/command/search_spec.rb
+0
-4
setup_spec.rb
spec/functional/command/setup_spec.rb
+0
-1
spec_spec.rb
spec/functional/command/spec_spec.rb
+0
-10
integration.rb
spec/integration.rb
+0
-9
spec_helper.rb
spec/spec_helper.rb
+0
-2
config_spec.rb
spec/unit/config_spec.rb
+0
-8
abstract_external_source_spec.rb
spec/unit/external_sources/abstract_external_source_spec.rb
+0
-4
path_source_spec.rb
spec/unit/external_sources/path_source_spec.rb
+0
-1
podspec_source_spec.rb
spec/unit/external_sources/podspec_source_spec.rb
+0
-2
acknowledgements_spec.rb
spec/unit/generator/acknowledgements_spec.rb
+0
-5
copy_resources_script_spec.rb
spec/unit/generator/copy_resources_script_spec.rb
+0
-2
dummy_source_spec.rb
spec/unit/generator/dummy_source_spec.rb
+0
-2
embed_frameworks_script_spec.rb
spec/unit/generator/embed_frameworks_script_spec.rb
+0
-2
header_spec.rb
spec/unit/generator/header_spec.rb
+0
-1
info_plist_file_spec.rb
spec/unit/generator/info_plist_file_spec.rb
+0
-2
module_map_spec.rb
spec/unit/generator/module_map_spec.rb
+0
-2
prefix_header_spec.rb
spec/unit/generator/prefix_header_spec.rb
+0
-1
target_environment_header_spec.rb
spec/unit/generator/target_environment_header_spec.rb
+0
-2
aggregate_xcconfig_spec.rb
spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb
+0
-8
private_pod_xcconfig_spec.rb
spec/unit/generator/xcconfig/private_pod_xcconfig_spec.rb
+0
-9
public_pod_xcconfig_spec.rb
spec/unit/generator/xcconfig/public_pod_xcconfig_spec.rb
+0
-2
xcconfig_helper_spec.rb
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
+0
-2
xcconfig_spec.rb
spec/unit/generator/xcconfig_spec.rb
+0
-1
installer_representation_spec.rb
spec/unit/hooks/installer_representation_spec.rb
+0
-6
library_representation_spec.rb
spec/unit/hooks/library_representation_spec.rb
+0
-6
pod_representation_spec.rb
spec/unit/hooks/pod_representation_spec.rb
+0
-4
sandbox_analyzer_spec.rb
spec/unit/installer/analyzer/sandbox_analyzer_spec.rb
+0
-9
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+0
-8
file_references_installer_spec.rb
spec/unit/installer/file_references_installer_spec.rb
+0
-6
pod_source_installer_spec.rb
spec/unit/installer/pod_source_installer_spec.rb
+0
-12
aggregate_target_installer_spec.rb
...aller/target_installer/aggregate_target_installer_spec.rb
+0
-2
pod_target_installer_spec.rb
...t/installer/target_installer/pod_target_installer_spec.rb
+0
-2
target_installer_spec.rb
spec/unit/installer/target_installer_spec.rb
+0
-2
xcconfig_integrator_spec.rb
..._integrator/target_integrator/xcconfig_integrator_spec.rb
+0
-2
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+0
-1
user_project_integrator_spec.rb
spec/unit/installer/user_project_integrator_spec.rb
+0
-9
installer_spec.rb
spec/unit/installer_spec.rb
+0
-36
library_spec.rb
spec/unit/library_spec.rb
+0
-2
project_spec.rb
spec/unit/project_spec.rb
+0
-17
resolver_spec.rb
spec/unit/resolver_spec.rb
+0
-2
file_accessor_spec.rb
spec/unit/sandbox/file_accessor_spec.rb
+0
-10
headers_store_spec.rb
spec/unit/sandbox/headers_store_spec.rb
+0
-1
path_list_spec.rb
spec/unit/sandbox/path_list_spec.rb
+0
-10
sandbox_spec.rb
spec/unit/sandbox_spec.rb
+0
-9
sources_manager_spec.rb
spec/unit/sources_manager_spec.rb
+0
-5
pod_target_spec.rb
spec/unit/target/pod_target_spec.rb
+0
-1
target_spec.rb
spec/unit/target_spec.rb
+0
-3
error_report_spec.rb
spec/unit/user_interface/error_report_spec.rb
+0
-1
user_interface_spec.rb
spec/unit/user_interface_spec.rb
+0
-3
validator_spec.rb
spec/unit/validator_spec.rb
+0
-3
No files found.
Gemfile.lock
View file @
0684132b
...
...
@@ -40,7 +40,7 @@ GIT
GIT
remote: https://github.com/CocoaPods/cocoapods-plugins.git
revision:
376141a815c8dcafdb8e1ca6e16eb9a380e9641d
revision:
4e60d8458d374ef54d3ba7d9592bd2750344df49
branch: master
specs:
cocoapods-plugins (0.4.0)
...
...
@@ -93,7 +93,7 @@ GEM
ast (2.0.0)
astrolabe (1.3.0)
parser (>= 2.2.0.pre.3, < 3.0)
awesome_print (1.
2.0
)
awesome_print (1.
6.1
)
bacon (1.2.0)
clintegracon (0.6.1)
colored (~> 1.2)
...
...
@@ -127,7 +127,7 @@ GEM
netrc (0.7.8)
notify (0.5.2)
open4 (1.3.4)
parser (2.2.0.
pre.7
)
parser (2.2.0.
1
)
ast (>= 1.1, < 3.0)
slop (~> 3.4, >= 3.4.5)
powerpack (0.0.9)
...
...
@@ -138,26 +138,26 @@ GEM
method_source (~> 0.8.1)
slop (~> 3.4)
rainbow (2.0.0)
rake (10.
3
.2)
rake (10.
4
.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rb-kqueue (0.2.3)
ffi (>= 0.5.0)
rubocop (0.2
7.1
)
rubocop (0.2
8.0
)
astrolabe (~> 1.3)
parser (>= 2.2.0.pre.7, < 3.0)
powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4)
ruby-prof (0.15.2)
ruby-progressbar (1.7.
0
)
ruby-progressbar (1.7.
1
)
safe_yaml (1.0.4)
slop (3.6.0)
thread_safe (0.3.4)
tzinfo (1.2.2)
thread_safe (~> 0.1)
webmock (1.20.
3
)
webmock (1.20.
4
)
addressable (>= 2.3.6)
crack (>= 0.3.2)
...
...
Rakefile
View file @
0684132b
...
...
@@ -75,7 +75,6 @@ begin
#-----------------------------------------------------------------------------#
namespace
:spec
do
def
specs
(
dir
)
FileList
[
"spec/
#{
dir
}
_spec.rb"
].
shuffle
.
join
(
' '
)
end
...
...
@@ -210,7 +209,6 @@ begin
task
:examples
=>
'examples:build'
namespace
:examples
do
desc
'Open all example workspaces in Xcode, which recreates the schemes.'
task
:recreate_workspace_schemes
do
examples
.
each
do
|
example
|
...
...
lib/cocoapods/command/lib.rb
View file @
0684132b
...
...
@@ -138,7 +138,6 @@ module Pod
def
run
UI
.
puts
podspecs_to_lint
.
each
do
|
podspec
|
validator
=
Validator
.
new
(
podspec
,
@source_urls
)
validator
.
local
=
true
validator
.
quick
=
@quick
...
...
lib/cocoapods/command/outdated.rb
View file @
0684132b
...
...
@@ -69,8 +69,6 @@ module Pod
matching_version
=
matching_spec
?
matching_spec
.
version
:
'(unused)'
[
pod_name
,
lockfile_version
,
matching_version
,
source_version
]
else
nil
end
end
.
compact
.
uniq
end
...
...
lib/cocoapods/downloader.rb
View file @
0684132b
...
...
@@ -7,7 +7,6 @@ module Pod
class
Base
override_api
do
def
execute_command
(
executable
,
command
,
raise_on_failure
=
false
)
Executable
.
execute_command
(
executable
,
command
,
raise_on_failure
)
rescue
CLAide
::
InformativeError
=>
e
...
...
@@ -56,7 +55,6 @@ module Pod
def
ui_message
(
message
)
UI
.
puts
message
end
end
end
end
...
...
lib/cocoapods/installer.rb
View file @
0684132b
...
...
@@ -479,7 +479,6 @@ module Pod
aggregate_target
.
native_target
.
add_dependency
(
pod_target
.
native_target
)
pod_target
.
dependencies
.
each
do
|
dep
|
unless
dep
==
pod_target
.
pod_name
pod_dependency_target
=
aggregate_target
.
pod_targets
.
find
{
|
target
|
target
.
pod_name
==
dep
}
# TODO remove me
...
...
lib/cocoapods/sandbox.rb
View file @
0684132b
...
...
@@ -231,8 +231,6 @@ module Pod
path
=
specifications_root
+
"
#{
name
}
.podspec.json"
if
path
.
exist?
path
else
nil
end
end
end
...
...
spec/functional/command/init_spec.rb
View file @
0684132b
...
...
@@ -4,7 +4,6 @@ require 'xcodeproj'
module
Pod
describe
Command
::
Init
do
it
'complains if project does not exist'
do
lambda
{
run_command
(
'init'
)
}.
should
.
raise
Informative
lambda
{
run_command
(
'init'
,
'foo.xcodeproj'
)
}.
should
.
raise
CLAide
::
Help
...
...
spec/functional/command/inter_process_communication_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Command
::
IPC
do
before
do
Command
::
IPC
::
Spec
.
any_instance
.
stubs
(
:output_pipe
).
returns
(
UI
)
Command
::
IPC
::
Podfile
.
any_instance
.
stubs
(
:output_pipe
).
returns
(
UI
)
...
...
@@ -12,20 +11,17 @@ module Pod
end
describe
Command
::
IPC
::
Spec
do
it
'converts a podspec to JSON and prints it to STDOUT'
do
out
=
run_command
(
'ipc'
,
'spec'
,
fixture
(
'banana-lib/BananaLib.podspec'
))
out
.
should
.
match
/"name": "BananaLib"/
out
.
should
.
match
/"version": "1.0"/
out
.
should
.
match
/"description": "Full of chunky bananas."/
end
end
#-------------------------------------------------------------------------#
describe
Command
::
IPC
::
Podfile
do
it
'converts a Podfile to yaml and prints it to STDOUT'
do
out
=
run_command
(
'ipc'
,
'podfile'
,
fixture
(
'Podfile'
))
out
.
should
.
include
(
'---'
)
...
...
@@ -33,13 +29,11 @@ module Pod
out
.
should
.
match
/platform: ios/
out
.
should
.
match
/- SSZipArchive:/
end
end
#-------------------------------------------------------------------------#
describe
Command
::
IPC
::
List
do
it
'prints a list of podspecs in the yaml format and prints it to STDOUT'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
set
=
Specification
::
Set
.
new
(
'BananaLib'
,
[])
...
...
@@ -51,25 +45,21 @@ module Pod
out
.
should
.
match
/BananaLib:/
out
.
should
.
match
/description: Full of chunky bananas./
end
end
#-------------------------------------------------------------------------#
describe
Command
::
IPC
::
UpdateSearchIndex
do
it
'updates the search index and prints its path to STDOUT'
do
SourcesManager
.
expects
(
:updated_search_index
)
out
=
run_command
(
'ipc'
,
'update-search-index'
)
out
.
should
.
include
(
SourcesManager
.
search_index_path
.
to_s
)
end
end
#-------------------------------------------------------------------------#
describe
Command
::
IPC
::
Repl
do
it
'prints the version of CocoaPods as its first message'
do
command
=
Command
::
IPC
::
Repl
.
new
(
CLAide
::
ARGV
.
new
([]))
command
.
stubs
(
:listen
)
...
...
@@ -90,10 +80,8 @@ module Pod
out
.
should
.
match
/- SSZipArchive:/
out
.
should
.
end_with?
(
"
\n\r\n
"
)
end
end
#-------------------------------------------------------------------------#
end
end
spec/functional/command/lib_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Command
::
Lib
::
Create
do
before
do
@sut
=
Command
::
Lib
::
Create
end
...
...
spec/functional/command/project_spec.rb
View file @
0684132b
...
...
@@ -2,23 +2,19 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Command
::
Project
do
it
'tells the user that no Podfile or podspec was found in the current working dir'
do
Command
::
Install
.
new
(
CLAide
::
ARGV
.
new
([
'--no-repo-update'
]))
config
.
skip_repo_update
.
should
.
be
.
true
end
end
#---------------------------------------------------------------------------#
describe
Command
::
Install
do
it
'tells the user that no Podfile or podspec was found in the project dir'
do
exception
=
lambda
{
run_command
(
'install'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the project directory."
end
end
#---------------------------------------------------------------------------#
...
...
@@ -83,7 +79,6 @@ module Pod
end
end
end
end
#---------------------------------------------------------------------------#
...
...
spec/functional/command/search_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Command
::
Search
do
extend
SpecHelper
::
TemporaryRepos
before
do
...
...
@@ -72,7 +71,6 @@ module Pod
end
describe
'option --web'
do
extend
SpecHelper
::
TemporaryRepos
it
'searches with invalid regex'
do
...
...
@@ -107,8 +105,6 @@ module Pod
Command
::
Search
.
any_instance
.
expects
(
:open!
).
with
(
'http://cocoapods.org/?q=on%3Aosx%20on%3Aios%20bananalib'
)
run_command
(
'search'
,
'--web'
,
'--osx'
,
'--ios'
,
'bananalib'
)
end
end
end
end
spec/functional/command/setup_spec.rb
View file @
0684132b
...
...
@@ -73,6 +73,5 @@ module Pod
source
.
should
.
not
.
exist?
target
.
should
.
exist?
end
end
end
spec/functional/command/spec_spec.rb
View file @
0684132b
...
...
@@ -20,9 +20,7 @@ end
module
Pod
describe
Command
::
Spec
do
describe
'In general'
do
it
'complains for wrong parameters'
do
lambda
{
run_command
(
'spec'
)
}.
should
.
raise
CLAide
::
Help
lambda
{
run_command
(
'spec'
,
'create'
)
}.
should
.
raise
CLAide
::
Help
...
...
@@ -353,24 +351,19 @@ module Pod
#-------------------------------------------------------------------------#
describe
'Private helpers'
do
before
do
# TODO Use class methods
@command
=
Command
::
Spec
.
new
(
CLAide
::
ARGV
.
new
([]))
end
describe
'#get_path_of_spec'
do
it
'returns the path of the specification with the given name'
do
path
=
@command
.
send
(
:get_path_of_spec
,
'AFNetworking'
)
path
.
should
==
fixture
(
'spec-repos'
)
+
'master/Specs/AFNetworking/2.4.1/AFNetworking.podspec.json'
end
end
describe
'#choose_from_array'
do
it
'should return a valid index for the given array'
do
UI
.
next_input
=
"1
\n
"
index
=
@command
.
send
(
:choose_from_array
,
%w(item1 item2 item3)
,
'A message'
)
...
...
@@ -384,12 +377,9 @@ module Pod
UI
.
next_input
=
"0
\n
"
lambda
{
@command
.
send
(
:choose_from_array
,
%w(item1 item2 item3)
,
'A message'
)
}.
should
.
raise
Pod
::
Informative
end
end
end
#-------------------------------------------------------------------------#
end
end
spec/integration.rb
View file @
0684132b
...
...
@@ -90,7 +90,6 @@ CLIntegracon.configure do |c|
end
describe_cli
'pod'
do
Process
.
wait
(
spawn
(
'which hg'
,
:err
=>
:out
,
:out
=>
'/dev/null'
))
has_mercurial
=
$?
.
success?
...
...
@@ -115,7 +114,6 @@ describe_cli 'pod' do
end
describe
'Pod install'
do
# Test installation with no integration
# Test subspecs inheritance
...
...
@@ -215,7 +213,6 @@ describe_cli 'pod' do
#--------------------------------------#
describe
'Pod update'
do
describe
'Updates an existing installation'
do
behaves_like
cli_spec
'update_all'
,
'update --no-repo-update'
...
...
@@ -225,31 +222,25 @@ describe_cli 'pod' do
behaves_like
cli_spec
'update_selected'
,
'update Reachability --no-repo-update'
end
end
#--------------------------------------#
describe
'Pod lint'
do
describe
'Lints a Pod'
do
behaves_like
cli_spec
'spec_lint'
,
'spec lint --quick'
end
end
#--------------------------------------#
describe
'Pod init'
do
describe
'Initializes a Podfile with a single platform'
do
behaves_like
cli_spec
'init_single_platform'
,
'init'
end
end
#--------------------------------------#
end
spec/spec_helper.rb
View file @
0684132b
...
...
@@ -61,8 +61,6 @@ module Pod
if
fixture
.
exist?
# puts "Using fixture [#{name}]"
result
[
:git
]
=
fixture
.
to_s
else
# puts "MISSING fixture [#{name}]"
end
result
end
...
...
spec/unit/config_spec.rb
View file @
0684132b
...
...
@@ -9,7 +9,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'In general'
do
it
'returns the singleton config instance'
do
@config
.
should
.
be
.
instance_of
Config
end
...
...
@@ -47,7 +46,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'Paths'
do
it
'returns the working directory as the installation root if a Podfile can be found'
do
Dir
.
chdir
(
temporary_directory
)
do
File
.
open
(
'Podfile'
,
'w'
)
{}
...
...
@@ -123,13 +121,11 @@ module Pod
it
'returns the search index file'
do
@config
.
search_index_file
.
to_s
.
should
.
end_with?
(
'search_index.yaml'
)
end
end
#-------------------------------------------------------------------------#
describe
'Default settings'
do
it
'prints out normal information'
do
@config
.
should
.
not
.
be
.
silent
end
...
...
@@ -150,7 +146,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'Private helpers'
do
it
'returns the path of the user settings file'
do
@config
.
send
(
:user_settings_file
).
should
==
Pathname
.
new
(
'~/.cocoapods/config.yaml'
).
expand_path
end
...
...
@@ -164,7 +159,6 @@ module Pod
#----------------------------------------#
describe
'#podfile_path_in_dir'
do
it
'detects the CocoaPods.podfile.yaml file'
do
expected
=
temporary_directory
+
'CocoaPods.podfile.yaml'
File
.
open
(
expected
,
'w'
)
{}
...
...
@@ -190,11 +184,9 @@ module Pod
path
=
@config
.
send
(
:podfile_path_in_dir
,
temporary_directory
)
path
.
should
.
nil?
end
end
#-----------------------------------------------------------------------#
end
end
end
spec/unit/external_sources/abstract_external_source_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
ExternalSources
::
AbstractExternalSource
do
before
do
dependency
=
Dependency
.
new
(
'Reachability'
,
:git
=>
fixture
(
'integration/Reachability'
))
@subject
=
ExternalSources
.
from_dependency
(
dependency
,
nil
)
...
...
@@ -12,7 +11,6 @@ module Pod
#--------------------------------------#
describe
'In general'
do
it
'compares to another'
do
dependency_1
=
Dependency
.
new
(
'Reachability'
,
:git
=>
'url'
)
dependency_2
=
Dependency
.
new
(
'Another_name'
,
:git
=>
'url'
)
...
...
@@ -28,13 +26,11 @@ module Pod
@subject
.
fetch
(
config
.
sandbox
)
config
.
sandbox
.
specification
(
'Reachability'
).
name
.
should
==
'Reachability'
end
end
#--------------------------------------#
describe
'Subclasses helpers'
do
it
'pre-downloads the Pod and stores the relevant information in the sandbox'
do
@subject
.
send
(
:pre_download
,
config
.
sandbox
)
path
=
config
.
sandbox
.
specifications_root
+
'Reachability.podspec.json'
...
...
spec/unit/external_sources/path_source_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
ExternalSources
::
PathSource
do
before
do
params
=
{
:path
=>
fixture
(
'integration/Reachability'
)
}
dependency
=
Dependency
.
new
(
'Reachability'
,
params
)
...
...
spec/unit/external_sources/podspec_source_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
ExternalSources
::
PodspecSource
do
before
do
podspec_path
=
fixture
(
'integration/Reachability/Reachability.podspec'
)
dependency
=
Dependency
.
new
(
'Reachability'
,
:podspec
=>
podspec_path
.
to_s
)
...
...
@@ -21,7 +20,6 @@ module Pod
end
describe
'Helpers'
do
it
'handles absolute paths'
do
@subject
.
stubs
(
:params
).
returns
(
:podspec
=>
fixture
(
'integration/Reachability'
))
path
=
@subject
.
send
(
:podspec_uri
)
...
...
spec/unit/generator/acknowledgements_spec.rb
View file @
0684132b
...
...
@@ -9,7 +9,6 @@ module Pod
end
describe
'In general'
do
it
'returns the classes of the concrete generators generators'
do
generators
=
Pod
::
Generator
::
Acknowledgements
.
generators
generators
.
map
{
|
g
|
g
.
name
.
split
(
'::'
).
last
}.
should
==
%w(Plist Markdown)
...
...
@@ -21,13 +20,11 @@ module Pod
@generator
.
footnote_title
.
should
.
be
.
kind_of
(
String
)
@generator
.
footnote_text
.
should
.
be
.
kind_of
(
String
)
end
end
#-----------------------------------------------------------------------#
describe
'Private methods'
do
it
'returns the root specifications'
do
generator
=
Pod
::
Generator
::
Acknowledgements
.
new
([
@file_accessor
,
@file_accessor
])
generator
.
send
(
:specs
).
should
==
[
@file_accessor
.
spec
]
...
...
@@ -49,10 +46,8 @@ module Pod
@generator
.
send
(
:license_text
,
@spec
)
UI
.
warnings
.
should
.
include
'Unable to read the license file'
end
end
#-----------------------------------------------------------------------#
end
end
spec/unit/generator/copy_resources_script_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Generator
::
CopyResourcesScript
do
it
'returns the copy resources script'
do
resources
=
[
'path/to/resource.png'
]
generator
=
Pod
::
Generator
::
CopyResourcesScript
.
new
(
resources
,
Platform
.
new
(
:ios
,
'6.0'
))
...
...
@@ -18,6 +17,5 @@ module Pod
generator_1
.
send
(
:script
).
should
.
not
.
include
'--reference-external-strings-file'
generator_2
.
send
(
:script
).
should
.
include
'--reference-external-strings-file'
end
end
end
spec/unit/generator/dummy_source_spec.rb
View file @
0684132b
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
Pod
::
Generator
::
DummySource
do
it
'generates a dummy source file with the appropriate class for the class name identifier'
do
generator
=
Pod
::
Generator
::
DummySource
.
new
(
'SomeIdentification'
)
file
=
temporary_directory
+
'PodsDummy.m'
...
...
@@ -27,5 +26,4 @@ describe Pod::Generator::DummySource do
@end
EOS
end
end
spec/unit/generator/embed_frameworks_script_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Generator
::
EmbedFrameworksScript
do
it
'returns the embed frameworks script'
do
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
frameworks
=
{
...
...
@@ -22,6 +21,5 @@ module Pod
fi
eos
end
end
end
spec/unit/generator/header_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Header
=
Generator
::
Header
do
before
do
@gen
=
Header
.
new
(
Pod
::
Platform
.
ios
)
end
...
...
spec/unit/generator/info_plist_file_spec.rb
View file @
0684132b
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
Pod
::
Generator
::
InfoPlistFile
do
describe
'#target_version'
do
it
'returns 1.0.0 for the aggregate target'
do
generator
=
Pod
::
Generator
::
InfoPlistFile
.
new
(
fixture_aggregate_target
)
...
...
@@ -26,5 +25,4 @@ describe Pod::Generator::InfoPlistFile do
`plutil -lint
#{
file
}
`
$?
.
should
.
be
.
success
end
end
spec/unit/generator/module_map_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Generator
::
ModuleMap
do
before
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
...
...
@@ -22,6 +21,5 @@ module Pod
}
EOS
end
end
end
spec/unit/generator/prefix_header_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
PrefixHeader
=
Generator
::
PrefixHeader
do
before
do
file_accessor
=
fixture_file_accessor
(
'banana-lib/BananaLib.podspec'
)
@spec
=
file_accessor
.
spec
...
...
spec/unit/generator/target_environment_header_spec.rb
View file @
0684132b
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
Pod
::
Generator
::
TargetEnvironmentHeader
do
before
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
@gen
=
Pod
::
Generator
::
TargetEnvironmentHeader
.
new
(
'Debug'
=>
[
spec
])
...
...
@@ -80,5 +79,4 @@ describe Pod::Generator::TargetEnvironmentHeader do
@gen
.
generate
.
should
.
include
'BUILD_CONFIGURATION_COPY'
@gen
.
generate
.
should
.
include
'BUILD__CONFIG_COPY'
end
end
spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb
View file @
0684132b
...
...
@@ -4,7 +4,6 @@ module Pod
module
Generator
module
XCConfig
describe
AggregateXCConfig
do
def
spec
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
end
...
...
@@ -21,7 +20,6 @@ module Pod
end
shared
'AggregateXCConfig'
do
it
'returns the path of the pods root relative to the user project'
do
@generator
.
target
.
relative_pods_root
.
should
==
'${SRCROOT}/Pods'
end
...
...
@@ -67,13 +65,11 @@ module Pod
it
'should configure OTHER_LIBTOOLFLAGS flags to include OTHER_LDFLAGS'
do
@xcconfig
.
to_hash
[
'OTHER_LIBTOOLFLAGS'
].
should
==
'$(OTHER_LDFLAGS)'
end
end
#-----------------------------------------------------------------------#
describe
'if a pod target does not contain source files'
do
before
do
@pod_target
.
file_accessors
.
first
.
stubs
(
:source_files
).
returns
([])
@xcconfig
=
@generator
.
generate
...
...
@@ -90,7 +86,6 @@ module Pod
it
'does link with vendored libraries'
do
@xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
.
include
'-l"Bananalib"'
end
end
#-----------------------------------------------------------------------#
...
...
@@ -155,7 +150,6 @@ module Pod
#-----------------------------------------------------------------------#
describe
'serializing and deserializing'
do
before
do
@path
=
temporary_directory
+
'sample.xcconfig'
@generator
.
save_as
(
@path
)
...
...
@@ -165,9 +159,7 @@ module Pod
generated
=
Xcodeproj
::
Config
.
new
(
@path
)
generated
.
class
.
should
==
Xcodeproj
::
Config
end
end
end
end
end
...
...
spec/unit/generator/xcconfig/private_pod_xcconfig_spec.rb
View file @
0684132b
...
...
@@ -4,7 +4,6 @@ module Pod
module
Generator
module
XCConfig
describe
PrivatePodXCConfig
do
describe
'in general'
do
before
do
@spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
...
...
@@ -69,13 +68,11 @@ module Pod
generated
=
Xcodeproj
::
Config
.
new
(
path
)
generated
.
class
.
should
==
Xcodeproj
::
Config
end
end
#-------------------------------------------------------------------------#
describe
'Private Helpers'
do
before
do
@config
=
PrivatePodXCConfig
.
new
(
stub
,
stub
)
end
...
...
@@ -83,7 +80,6 @@ module Pod
#----------------------------------------#
describe
'#add_xcconfig_namespaced_keys'
do
it
'appends to the values of the keys of the destination the value of the keys of the source'
do
source_config
=
{
'HEADER_SEARCH_PATHS'
=>
'${PODS_ROOT}/MyPod'
}
destination_config
=
{
'HEADER_SEARCH_PATHS'
=>
'${PODS_ROOT}/BuildHeaders'
}
...
...
@@ -104,13 +100,11 @@ module Pod
result
=
@config
.
send
(
:add_xcconfig_namespaced_keys
,
source_config
,
destination_config
,
'PREFIX_'
)
result
.
should
==
{
'EXCLUDED_SOURCE_FILE_NAMES'
=>
'${PREFIX_EXCLUDED_SOURCE_FILE_NAMES}'
}
end
end
#----------------------------------------#
describe
'#conditional_less_key'
do
it
'returns the key without the xcconfig conditional syntax if present'
do
result
=
@config
.
send
(
:conditional_less_key
,
'EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*][arch=*]'
)
result
.
should
==
'EXCLUDED_SOURCE_FILE_NAMES'
...
...
@@ -120,13 +114,10 @@ module Pod
result
=
@config
.
send
(
:conditional_less_key
,
'EXCLUDED_SOURCE_FILE_NAMES'
)
result
.
should
==
'EXCLUDED_SOURCE_FILE_NAMES'
end
end
end
#-------------------------------------------------------------------------#
end
end
end
...
...
spec/unit/generator/xcconfig/public_pod_xcconfig_spec.rb
View file @
0684132b
...
...
@@ -4,7 +4,6 @@ module Pod
module
Generator
module
XCConfig
describe
PublicPodXCConfig
do
before
do
@spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
@target_definition
=
Podfile
::
TargetDefinition
.
new
(
'Pods'
,
nil
)
...
...
@@ -92,7 +91,6 @@ module Pod
generated
=
Xcodeproj
::
Config
.
new
(
@path
)
generated
.
to_hash
.
each
{
|
k
,
_v
|
k
.
should
.
start_with
(
@pod_target
.
xcconfig_prefix
)
}
end
end
end
end
...
...
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
View file @
0684132b
...
...
@@ -4,7 +4,6 @@ module Pod
module
Generator
module
XCConfig
describe
XCConfigHelper
do
before
do
@sut
=
XCConfigHelper
end
...
...
@@ -207,7 +206,6 @@ module Pod
end
#---------------------------------------------------------------------#
end
end
end
...
...
spec/unit/generator/xcconfig_spec.rb
View file @
0684132b
...
...
@@ -2,6 +2,5 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Generator
::
XCConfig
do
end
end
spec/unit/hooks/installer_representation_spec.rb
View file @
0684132b
...
...
@@ -7,7 +7,6 @@ end
module
Pod
describe
Hooks
::
InstallerRepresentation
do
before
do
podfile
=
Pod
::
Podfile
.
new
do
platform
:ios
...
...
@@ -24,7 +23,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'Public Hooks API'
do
it
'returns the sandbox root'
do
@rep
.
sandbox_root
.
should
==
config
.
sandbox
.
root
end
...
...
@@ -55,13 +53,11 @@ module Pod
target_definition
=
@installer
.
aggregate_targets
.
first
.
pod_targets
.
first
.
target_definition
pods_by_lib
[
target_definition
].
map
(
&
:name
).
should
==
[
'JSONKit'
]
end
end
#-------------------------------------------------------------------------#
describe
'Unsafe Hooks API'
do
it
'returns the sandbox'
do
@rep
.
sandbox
.
should
==
config
.
sandbox
end
...
...
@@ -73,10 +69,8 @@ module Pod
it
'returns the installer'
do
@rep
.
installer
.
should
==
@installer
end
end
#-------------------------------------------------------------------------#
end
end
spec/unit/hooks/library_representation_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Hooks
::
LibraryRepresentation
do
before
do
@target_definition
=
Podfile
::
TargetDefinition
.
new
(
'MyApp'
,
nil
)
@spec
=
Spec
.
new
...
...
@@ -14,7 +13,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'Public Hooks API'
do
it
'returns the name'
do
@rep
.
name
.
should
==
'Pods-MyApp'
end
...
...
@@ -47,13 +45,11 @@ module Pod
it
'returns the target definition'
do
@rep
.
target_definition
.
should
==
@target_definition
end
end
#-------------------------------------------------------------------------#
describe
'Unsafe Hooks API'
do
it
'returns the sandbox'
do
@rep
.
sandbox
.
should
==
config
.
sandbox
end
...
...
@@ -67,10 +63,8 @@ module Pod
@lib
.
native_target
=
target
@rep
.
target
.
should
==
target
end
end
#-------------------------------------------------------------------------#
end
end
spec/unit/hooks/pod_representation_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Hooks
::
PodRepresentation
do
before
do
@spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
@root
=
fixture
(
'banana-lib'
)
...
...
@@ -13,7 +12,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'Public Hooks API'
do
it
'returns the name'
do
@rep
.
name
.
should
==
'BananaLib'
end
...
...
@@ -43,10 +41,8 @@ module Pod
'Classes/BananaTrace.d'
,
]
end
end
#-------------------------------------------------------------------------#
end
end
spec/unit/installer/analyzer/sandbox_analyzer_spec.rb
View file @
0684132b
...
...
@@ -4,7 +4,6 @@ require File.expand_path('../../../../spec_helper', __FILE__)
module
Pod
describe
Installer
::
Analyzer
::
SandboxAnalyzer
do
before
do
@spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
@sandbox
=
config
.
sandbox
...
...
@@ -17,7 +16,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'Analysis'
do
it
'returns the sandbox state'
do
@analyzer
.
stubs
(
:folder_exist?
).
returns
(
true
)
@analyzer
.
stubs
(
:folder_empty?
).
returns
(
false
)
...
...
@@ -31,13 +29,11 @@ module Pod
@sandbox
.
stubs
(
:manifest
)
@analyzer
.
analyze
.
added
.
should
==
[
'BananaLib'
]
end
end
#-------------------------------------------------------------------------#
describe
'Analysis'
do
before
do
@analyzer
.
stubs
(
:folder_exist?
).
returns
(
true
)
@analyzer
.
stubs
(
:folder_empty?
).
returns
(
false
)
...
...
@@ -105,13 +101,11 @@ module Pod
@analyzer
.
stubs
(
:update_mode?
).
returns
(
false
)
@analyzer
.
send
(
:pod_changed?
,
'BananaLib'
).
should
==
false
end
end
#-------------------------------------------------------------------------#
describe
'Private helpers'
do
it
'returns the sandbox manifest'
do
@analyzer
.
send
(
:sandbox_manifest
).
should
==
@manifest
end
...
...
@@ -171,7 +165,6 @@ module Pod
path
=
temporary_directory
+
'Pods/BananaLib'
path
.
mkpath
@analyzer
.
send
(
:folder_exist?
,
'BananaLib'
).
should
.
be
.
true
end
it
'returns whether the folder containing the Pod with the given name is empty'
do
...
...
@@ -181,10 +174,8 @@ module Pod
File
.
open
(
path
+
'file'
,
'w'
)
{}
@analyzer
.
send
(
:folder_empty?
,
'BananaLib'
).
should
.
be
.
false
end
end
#-------------------------------------------------------------------------#
end
end
spec/unit/installer/analyzer_spec.rb
View file @
0684132b
...
...
@@ -4,7 +4,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Installer
::
Analyzer
do
describe
'Analysis'
do
before
do
@podfile
=
Pod
::
Podfile
.
new
do
...
...
@@ -286,7 +285,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'Private helpers'
do
describe
'#compute_user_project_targets'
do
it
'uses the path specified in the target definition while computing the path of the user project'
do
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
...
...
@@ -343,7 +341,6 @@ module Pod
#--------------------------------------#
describe
'#compute_user_project_targets'
do
it
'returns the targets specified in the target definition'
do
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
target_definition
.
link_with
=
[
'UserTarget'
]
...
...
@@ -398,13 +395,11 @@ module Pod
e
=
lambda
{
@analyzer
.
send
(
:compute_user_project_targets
,
target_definition
,
user_project
)
}.
should
.
raise
Informative
e
.
message
.
should
.
match
/Unable to find a target/
end
end
#--------------------------------------#
describe
'#compute_user_build_configurations'
do
it
'returns the user build configurations of the user targets'
do
user_project
=
Xcodeproj
::
Project
.
new
(
'path'
)
target
=
user_project
.
new_target
(
:application
,
'Target'
,
:ios
)
...
...
@@ -431,13 +426,11 @@ module Pod
configurations
=
@analyzer
.
send
(
:compute_user_build_configurations
,
target_definition
,
user_targets
)
configurations
.
should
==
{
'AppStore'
=>
:release
}
end
end
#--------------------------------------#
describe
'#compute_archs_for_target_definition'
do
it
'handles a single ARCH defined in a single user target'
do
user_project
=
Xcodeproj
::
Project
.
new
(
'path'
)
target
=
user_project
.
new_target
(
:application
,
'Target'
,
:ios
)
...
...
@@ -498,7 +491,6 @@ module Pod
#--------------------------------------#
describe
'#compute_platform_for_target_definition'
do
it
'returns the platform specified in the target definition'
do
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
target_definition
.
set_platform
(
:ios
,
'4.0'
)
...
...
spec/unit/installer/file_references_installer_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Installer
::
FileReferencesInstaller
do
before
do
@file_accessor
=
fixture_file_accessor
(
'banana-lib/BananaLib.podspec'
)
@pod_target
=
PodTarget
.
new
([],
nil
,
config
.
sandbox
)
...
...
@@ -16,7 +15,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'Installation'
do
it
'adds the files references of the source files the Pods project'
do
@file_accessor
.
path_list
.
read_file_system
@file_accessor
.
path_list
.
expects
(
:read_file_system
)
...
...
@@ -70,13 +68,11 @@ module Pod
public_header
.
should
.
exist
private_header
.
should
.
not
.
exist
end
end
#-------------------------------------------------------------------------#
describe
'Private Helpers'
do
describe
'#file_accessors'
do
it
'returns the file accessors'
do
pod_target_1
=
PodTarget
.
new
([],
nil
,
config
.
sandbox
)
...
...
@@ -129,10 +125,8 @@ module Pod
}
end
end
end
#-------------------------------------------------------------------------#
end
end
spec/unit/installer/pod_source_installer_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Installer
::
PodSourceInstaller
do
before
do
@spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
)
}
...
...
@@ -13,7 +12,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'Installation'
do
describe
'Download'
do
it
'downloads the source'
do
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
),
:tag
=>
'v1.0'
}
...
...
@@ -80,7 +78,6 @@ module Pod
@installer
.
install!
end
.
message
.
should
.
match
/does not support the :head option, as it uses a Http source./
end
end
#--------------------------------------#
...
...
@@ -109,13 +106,11 @@ module Pod
@spec
.
prepare_command
=
'cd Classes;ls Banana.h'
lambda
{
@installer
.
install!
}.
should
.
not
.
raise
end
end
#--------------------------------------#
describe
'Cleaning'
do
it
'cleans the paths non used by the installation'
do
@installer
.
install!
@installer
.
clean!
...
...
@@ -129,13 +124,11 @@ module Pod
readme_file
=
config
.
sandbox
.
root
+
'BananaLib/README'
readme_file
.
should
.
exist
end
end
#--------------------------------------#
describe
'Options'
do
it
"doesn't downloads the source if the pod was already downloaded"
do
@installer
.
stubs
(
:predownloaded?
).
returns
(
true
)
@installer
.
expects
(
:download_source
).
never
...
...
@@ -154,17 +147,14 @@ module Pod
@installer
.
expects
(
:clean_installation
).
never
@installer
.
install!
end
end
#--------------------------------------#
end
#-------------------------------------------------------------------------#
describe
'Private Helpers'
do
it
'returns the clean paths'
do
@installer
.
send
(
:download_source
)
paths
=
@installer
.
send
(
:clean_paths
)
...
...
@@ -236,10 +226,8 @@ module Pod
paths
=
@installer
.
send
(
:used_files
)
paths
.
should
==
[]
end
end
#-------------------------------------------------------------------------#
end
end
spec/unit/installer/target_installer/aggregate_target_installer_spec.rb
View file @
0684132b
...
...
@@ -143,11 +143,9 @@ module Pod
end
xit
'adds the resources bundles to the copy resources script'
do
end
xit
'adds the bridge support file to the copy resources script, if one was created'
do
end
it
'does add pods to the embed frameworks script'
do
...
...
spec/unit/installer/target_installer/pod_target_installer_spec.rb
View file @
0684132b
...
...
@@ -119,7 +119,6 @@ module Pod
end
xit
'adds the build configurations to the resources bundle targets'
do
end
#--------------------------------------#
...
...
@@ -211,7 +210,6 @@ module Pod
end
describe
'concerning ARC before and after iOS 6.0 and OS X 10.8'
do
it
'does not do anything if ARC is *not* required'
do
@spec
.
ios
.
deployment_target
=
'5'
@spec
.
osx
.
deployment_target
=
'10.6'
...
...
spec/unit/installer/target_installer_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Installer
::
TargetInstaller
do
before
do
@podfile
=
Podfile
.
new
do
platform
:ios
...
...
@@ -45,6 +44,5 @@ module Pod
@installer
.
send
(
:native_target
).
resolved_build_setting
(
'OTHER_LDFLAGS'
).
values
.
uniq
.
should
==
[
''
]
@installer
.
send
(
:native_target
).
resolved_build_setting
(
'OTHER_LIBTOOLFLAGS'
).
values
.
uniq
.
should
==
[
''
]
end
end
end
spec/unit/installer/user_project_integrator/target_integrator/xcconfig_integrator_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../../../spec_helper', __FILE__)
module
Pod
describe
XCConfigIntegrator
=
Installer
::
UserProjectIntegrator
::
TargetIntegrator
::
XCConfigIntegrator
do
before
do
project_path
=
SpecHelper
.
create_sample_app_copy_from_fixture
(
'SampleProject'
)
@project
=
Xcodeproj
::
Project
.
open
(
project_path
)
...
...
@@ -71,6 +70,5 @@ module Pod
UI
.
warnings
.
should
.
not
.
match
/not set.*base configuration/
end
end
end
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
0684132b
...
...
@@ -3,7 +3,6 @@ require File.expand_path('../../../../spec_helper', __FILE__)
module
Pod
describe
TargetIntegrator
=
Installer
::
UserProjectIntegrator
::
TargetIntegrator
do
describe
'In general'
do
# The project contains a `PBXReferenceProxy` in the build files of the
# frameworks build phase which implicitly checks for the robustness of
# the detection of the target.
...
...
spec/unit/installer/user_project_integrator_spec.rb
View file @
0684132b
...
...
@@ -2,9 +2,7 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
UserProjectIntegrator
=
Installer
::
UserProjectIntegrator
do
describe
'In general'
do
before
do
@sample_project_path
=
SpecHelper
.
create_sample_app_copy_from_fixture
(
'SampleProject'
)
sample_project_path
=
@sample_project_path
...
...
@@ -13,7 +11,6 @@ module Pod
xcodeproj
sample_project_path
pod
'JSONKit'
target
:empty
do
end
end
config
.
sandbox
.
project
=
Project
.
new
(
config
.
sandbox
.
project_path
)
...
...
@@ -93,13 +90,11 @@ module Pod
UI
.
warnings
.
should
.
not
.
include
'CODE_SIGN_IDENTITY'
end
end
end
#-----------------------------------------------------------------------#
describe
'Workspace creation'
do
it
'creates a new workspace if needed'
do
@integrator
.
send
(
:create_workspace
)
workspace_path
=
@integrator
.
send
(
:workspace_path
)
...
...
@@ -166,13 +161,11 @@ module Pod
'SampleProject/SampleProject.xcodeproj'
,
]
end
end
#-----------------------------------------------------------------------#
describe
'Private Helpers'
do
it
'uses the path of the workspace defined in the podfile'
do
path
=
'a_path'
@podfile
.
workspace
(
path
)
...
...
@@ -199,11 +192,9 @@ module Pod
@integrator
.
targets
.
map
(
&
:name
).
should
==
[
'Pods'
,
'Pods-empty'
]
@integrator
.
send
(
:targets_to_integrate
).
map
(
&
:name
).
should
==
[
'Pods'
]
end
end
#-----------------------------------------------------------------------#
end
end
end
spec/unit/installer_spec.rb
View file @
0684132b
...
...
@@ -35,7 +35,6 @@ end
module
Pod
describe
Installer
do
before
do
podfile
=
generate_podfile
lockfile
=
generate_lockfile
...
...
@@ -46,7 +45,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'In general'
do
before
do
@installer
.
stubs
(
:resolve_dependencies
)
@installer
.
stubs
(
:download_dependencies
)
...
...
@@ -113,13 +111,11 @@ module Pod
UI
.
warnings
.
should
.
include
'deprecated in favor of AFNetworking'
UI
.
warnings
.
should
.
include
'BlocksKit has been deprecated'
end
end
#-------------------------------------------------------------------------#
describe
'#determine_dependency_product_type'
do
it
'does propagate that frameworks are required to all pod targets'
do
fixture_path
=
ROOT
+
'spec/fixtures'
config
.
repos_dir
=
fixture_path
+
'spec-repos'
...
...
@@ -144,15 +140,12 @@ module Pod
'Pods-monkey'
,
]
end
end
#-------------------------------------------------------------------------#
describe
'Dependencies Resolution'
do
describe
'#analyze'
do
it
'prints a warning if the version of the Lockfile is higher than the one of the executable'
do
Lockfile
.
any_instance
.
stubs
(
:cocoapods_version
).
returns
(
Version
.
new
(
'999'
))
STDERR
.
expects
(
:puts
)
...
...
@@ -177,7 +170,6 @@ module Pod
@installer
.
aggregate_targets
.
map
(
&
:name
).
sort
.
should
==
[
'Pods'
]
@installer
.
pod_targets
.
map
(
&
:name
).
sort
.
should
==
[
'Pods-JSONKit'
]
end
end
#--------------------------------------#
...
...
@@ -205,7 +197,6 @@ module Pod
#--------------------------------------#
describe
'#clean_sandbox'
do
before
do
@analysis_result
=
Installer
::
Analyzer
::
AnalysisResult
.
new
@analysis_result
.
specifications
=
[]
...
...
@@ -228,15 +219,12 @@ module Pod
config
.
sandbox
.
expects
(
:clean_pod
).
with
(
'Deleted-Pod'
)
@installer
.
send
(
:clean_sandbox
)
end
end
end
#-------------------------------------------------------------------------#
describe
'Downloading dependencies'
do
it
'installs head pods'
do
podfile
=
Podfile
.
new
do
platform
:osx
,
'10.10'
...
...
@@ -255,7 +243,6 @@ module Pod
end
describe
'#install_pod_sources'
do
it
'installs all the Pods which are marked as needing installation'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
spec_2
=
Spec
.
new
...
...
@@ -310,26 +297,21 @@ module Pod
#--------------------------------------#
describe
'#clean'
do
it
'it cleans only if the config instructs to do it'
do
config
.
clean
=
false
@installer
.
send
(
:clean_pod_sources
)
Installer
::
PodSourceInstaller
.
any_instance
.
expects
(
:install!
).
never
end
end
#--------------------------------------#
end
end
#-------------------------------------------------------------------------#
describe
'Generating pods project'
do
describe
'#prepare_pods_project'
do
before
do
@installer
.
stubs
(
:aggregate_targets
).
returns
([])
end
...
...
@@ -389,25 +371,21 @@ module Pod
build_setting
[
'IPHONEOS_DEPLOYMENT_TARGET'
].
should
==
'6.0'
end
end
end
#--------------------------------------#
describe
'#install_file_references'
do
it
'installs the file references'
do
@installer
.
stubs
(
:pod_targets
).
returns
([])
Installer
::
FileReferencesInstaller
.
any_instance
.
expects
(
:install!
)
@installer
.
send
(
:install_file_references
)
end
end
#--------------------------------------#
describe
'#install_libraries'
do
it
'install the targets of the Pod project'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
...
...
@@ -435,13 +413,11 @@ module Pod
names
=
@installer
.
sandbox
.
project
[
'Frameworks'
].
children
.
map
(
&
:name
)
names
.
sort
.
should
==
[
'Foundation.framework'
,
'QuartzCore.framework'
]
end
end
#--------------------------------------#
describe
'#set_target_dependencies'
do
it
'sets resource bundles for not build pods as target dependencies of the user target'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
@installer
.
podfile
)
...
...
@@ -463,23 +439,18 @@ module Pod
end
xit
'sets the pod targets as dependencies of the aggregate target'
do
end
xit
'sets the dependecies of the pod targets'
do
end
xit
'is robusts against subspecs'
do
end
end
#--------------------------------------#
describe
'#write_pod_project'
do
before
do
@installer
.
stubs
(
:aggregate_targets
).
returns
([])
@installer
.
stubs
(
:analysis_result
).
returns
(
stub
(
:all_user_build_configurations
=>
{}))
...
...
@@ -498,13 +469,11 @@ module Pod
@installer
.
pods_project
.
expects
(
:save
)
@installer
.
send
(
:write_pod_project
)
end
end
#--------------------------------------#
describe
'#write_lockfiles'
do
before
do
@analysis_result
=
Installer
::
Analyzer
::
AnalysisResult
.
new
@analysis_result
.
specifications
=
[
fixture_spec
(
'banana-lib/BananaLib.podspec'
)]
...
...
@@ -527,21 +496,17 @@ module Pod
lockfile
=
Lockfile
.
from_file
(
temporary_directory
+
'Pods/Manifest.lock'
)
lockfile
.
pod_names
.
should
==
[
'BananaLib'
]
end
end
end
#-------------------------------------------------------------------------#
describe
'Integrating client projects'
do
it
'integrates the client projects'
do
@installer
.
stubs
(
:aggregate_targets
).
returns
([
AggregateTarget
.
new
(
nil
,
config
.
sandbox
)])
Installer
::
UserProjectIntegrator
.
any_instance
.
expects
(
:integrate!
)
@installer
.
send
(
:integrate_user_project
)
end
end
describe
'Plugins Hooks'
do
...
...
@@ -590,7 +555,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'Hooks'
do
before
do
@installer
.
send
(
:analyze
)
@specs
=
@installer
.
pod_targets
.
map
(
&
:specs
).
flatten
...
...
spec/unit/library_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../spec_helper', __FILE__)
module
Pod
describe
Pod
::
AggregateTarget
do
describe
'In general'
do
before
do
@target_definition
=
Podfile
::
TargetDefinition
.
new
(
'Pods'
,
nil
)
...
...
@@ -68,7 +67,6 @@ module Pod
it
'returns the path of the xcconfig file relative to the user project'
do
@lib
.
xcconfig_relative_path
(
'Release'
).
should
==
'Pods/Target Support Files/Pods/Pods.release.xcconfig'
end
end
end
end
spec/unit/project_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../spec_helper', __FILE__)
module
Pod
describe
Project
do
before
do
@project
=
Project
.
new
(
config
.
sandbox
.
project_path
)
end
...
...
@@ -10,7 +9,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'In general'
do
it
'creates the support files group on initialization'
do
@project
.
support_files_group
.
name
.
should
==
'Targets Support Files'
end
...
...
@@ -22,15 +20,12 @@ module Pod
it
'creates the development Pods group on initialization'
do
@project
.
development_pods
.
name
.
should
==
'Development Pods'
end
end
#-------------------------------------------------------------------------#
describe
'Pod Groups'
do
describe
'#add_pod_group'
do
before
do
@path
=
config
.
sandbox
.
pod_dir
(
'BananaLib'
)
end
...
...
@@ -63,13 +58,11 @@ module Pod
group
.
path
.
should
==
@path
.
to_s
Pathname
.
new
(
group
.
path
).
should
.
be
.
absolute
end
end
#----------------------------------------#
describe
'#pod_groups'
do
before
do
@project
.
add_pod_group
(
'BananaLib'
,
config
.
sandbox
.
pod_dir
(
'BananaLib'
))
@project
.
add_pod_group
(
'OrangeLib'
,
config
.
sandbox
.
pod_dir
(
'OrangeLib'
),
true
)
...
...
@@ -83,7 +76,6 @@ module Pod
@project
.
pods
.
children
.
map
(
&
:name
).
sort
.
should
==
[
'BananaLib'
]
@project
.
development_pods
.
children
.
map
(
&
:name
).
sort
.
should
==
[
'OrangeLib'
]
end
end
#----------------------------------------#
...
...
@@ -96,7 +88,6 @@ module Pod
#----------------------------------------#
describe
'#group_for_spec'
do
before
do
@project
.
add_pod_group
(
'BananaLib'
,
config
.
sandbox
.
pod_dir
(
'BananaLib'
))
end
...
...
@@ -133,7 +124,6 @@ module Pod
#----------------------------------------#
describe
'#pod_support_files_group'
do
before
do
@project
.
add_pod_group
(
'BananaLib'
,
@path
,
false
,
true
)
end
...
...
@@ -148,16 +138,13 @@ module Pod
group_2
=
@project
.
pod_support_files_group
(
'BananaLib'
,
'path'
)
group_1
.
uuid
.
should
==
group_2
.
uuid
end
end
end
#-------------------------------------------------------------------------#
describe
'File references'
do
describe
'#reference_for_path'
do
before
do
@project
.
add_pod_group
(
'BananaLib'
,
config
.
sandbox
.
pod_dir
(
'BananaLib'
),
false
)
@file
=
config
.
sandbox
.
pod_dir
(
'BananaLib'
)
+
'file.m'
...
...
@@ -187,13 +174,11 @@ module Pod
@project
.
add_file_reference
(
'relative/path/to/file.m'
,
@group
)
end
.
message
.
should
.
match
/Paths must be absolute/
end
end
#----------------------------------------#
describe
'#reference_for_path'
do
before
do
@project
.
add_pod_group
(
'BananaLib'
,
config
.
sandbox
.
pod_dir
(
'BananaLib'
),
false
)
@file
=
config
.
sandbox
.
pod_dir
(
'BananaLib'
)
+
'file.m'
...
...
@@ -217,7 +202,6 @@ module Pod
@project
.
reference_for_path
(
'relative/path/to/file.m'
)
end
.
message
.
should
.
match
/Paths must be absolute/
end
end
#----------------------------------------#
...
...
@@ -268,6 +252,5 @@ module Pod
end
#-------------------------------------------------------------------------#
end
end
spec/unit/resolver_spec.rb
View file @
0684132b
...
...
@@ -473,13 +473,11 @@ module Pod
resolved
[
osx_target
].
map
(
&
:to_s
).
should
.
include
osx_dependency
end
end
end
#-------------------------------------------------------------------------#
describe
'Pre-release versions'
do
it
'resolves explicitly requested pre-release versions'
do
@podfile
=
Podfile
.
new
do
platform
:ios
,
'6.0'
...
...
spec/unit/sandbox/file_accessor_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
FileAccessor
=
Sandbox
::
FileAccessor
do
before
do
@root
=
fixture
(
'banana-lib'
)
@path_list
=
Sandbox
::
PathList
.
new
(
@root
)
...
...
@@ -12,7 +11,6 @@ module Pod
end
describe
'In general'
do
it
'raises if the consumer is nil'
do
e
=
lambda
{
FileAccessor
.
new
(
@path_list
,
nil
)
}.
should
.
raise
Informative
e
.
message
.
should
.
match
/without a specification consumer/
...
...
@@ -37,13 +35,11 @@ module Pod
it
'returns the platform for which the spec is being consumed'
do
@accessor
.
platform_name
.
should
==
:ios
end
end
#-------------------------------------------------------------------------#
describe
'Returning files'
do
it
'returns the source files'
do
@accessor
.
source_files
.
sort
.
should
==
[
@root
+
'Classes/Banana.h'
,
...
...
@@ -202,15 +198,12 @@ module Pod
]
end
end
end
#-------------------------------------------------------------------------#
describe
'Private helpers'
do
describe
'#paths_for_attribute'
do
it
'takes into account dir patterns and excluded files'
do
file_patterns
=
[
'Classes/*.{h,m,d}'
,
'Vendor'
]
options
=
{
...
...
@@ -222,12 +215,9 @@ module Pod
@accessor
.
expects
(
:expanded_paths
).
with
(
file_patterns
,
options
)
@accessor
.
send
(
:paths_for_attribute
,
:source_files
)
end
end
end
#-------------------------------------------------------------------------#
end
end
spec/unit/sandbox/headers_store_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Sandbox
::
HeadersStore
do
before
do
@sandbox
=
Pod
::
Sandbox
.
new
(
temporary_directory
+
'Sandbox'
)
@header_dir
=
Sandbox
::
HeadersStore
.
new
(
@sandbox
,
'Public'
)
...
...
spec/unit/sandbox/path_list_spec.rb
View file @
0684132b
...
...
@@ -2,13 +2,11 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Sandbox
::
PathList
do
before
do
@path_list
=
Sandbox
::
PathList
.
new
(
fixture
(
'banana-lib'
))
end
describe
'In general'
do
it
'creates the list of all the files'
do
files
=
@path_list
.
files
files
.
reject!
do
|
f
|
...
...
@@ -60,7 +58,6 @@ module Pod
@path_list
=
Sandbox
::
PathList
.
new
(
root
)
@path_list
.
files
.
should
==
[
'Class.h'
]
end
end
#-------------------------------------------------------------------------#
...
...
@@ -134,13 +131,11 @@ module Pod
Resources/sub_dir
)
end
end
#-------------------------------------------------------------------------#
describe
'Private Helpers'
do
describe
'#directory?'
do
it
'detects a directory'
do
@path_list
.
send
(
:directory?
,
'classes'
).
should
==
true
...
...
@@ -178,25 +173,20 @@ module Pod
Classes/file.m
)
end
end
#--------------------------------------#
describe
'#escape_path_for_glob'
do
it
'escapes metacharacters'
do
escaped
=
@path_list
.
send
(
:escape_path_for_glob
,
'[]{}?**'
)
escaped
.
to_s
.
should
==
'\[\]\{\}\?\*\*'
end
end
#--------------------------------------#
end
#-------------------------------------------------------------------------#
end
end
spec/unit/sandbox_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../spec_helper', __FILE__)
module
Pod
describe
Sandbox
do
before
do
@sandbox
=
Pod
::
Sandbox
.
new
(
temporary_directory
+
'Sandbox'
)
end
...
...
@@ -10,7 +9,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'In general'
do
it
'reads the real path of the root so it can be used to build relative paths'
do
root_realpath
=
temporary_directory
+
'Folder/SubFolder'
FileUtils
.
mkdir_p
(
root_realpath
)
...
...
@@ -54,13 +52,11 @@ module Pod
@sandbox
.
clean_pod
(
'BananaLib'
)
pod_root
.
should
.
exist
end
end
#-------------------------------------------------------------------------#
describe
'Paths'
do
it
'returns the path of the manifest'
do
@sandbox
.
manifest_path
.
should
==
temporary_directory
+
'Sandbox/Manifest.lock'
...
...
@@ -97,7 +93,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'Specification store'
do
it
'loads the stored specification with the given name'
do
(
@sandbox
.
specifications_root
).
mkdir
FileUtils
.
cp
(
fixture
(
'banana-lib/BananaLib.podspec'
),
@sandbox
.
specifications_root
)
...
...
@@ -142,13 +137,11 @@ module Pod
path
.
should
.
exist
@sandbox
.
specification_path
(
'BananaLib'
).
should
==
path
end
end
#-------------------------------------------------------------------------#
describe
'Pods information'
do
it
'stores the list of the names of the pre-downloaded pods'
do
@sandbox
.
store_pre_downloaded_pod
(
'BananaLib'
)
@sandbox
.
predownloaded_pods
.
should
==
[
'BananaLib'
]
...
...
@@ -212,10 +205,8 @@ module Pod
@sandbox
.
local?
(
'BananaLib/Subspec'
).
should
.
be
.
true
@sandbox
.
local?
(
'Monkey'
).
should
.
be
.
false
end
end
#-------------------------------------------------------------------------#
end
end
spec/unit/sources_manager_spec.rb
View file @
0684132b
...
...
@@ -28,7 +28,6 @@ end
module
Pod
describe
SourcesManager
do
before
do
@test_source
=
Source
.
new
(
fixture
(
'spec-repos/test_repo'
))
end
...
...
@@ -36,7 +35,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'In general'
do
before
do
SourcesManager
.
stubs
(
:all
).
returns
([
@test_source
])
end
...
...
@@ -299,13 +297,11 @@ module Pod
it
"it returns an empty array for the version information if the file can't be found"
do
SourcesManager
.
version_information
(
temporary_directory
).
should
==
{}
end
end
#-------------------------------------------------------------------------#
describe
'Master repo'
do
it
'returns the master repo dir'
do
SourcesManager
.
master_repo_dir
.
to_s
.
should
.
match
/fixtures\/spec-repos\/master/
end
...
...
@@ -315,7 +311,6 @@ module Pod
config
.
repos_dir
=
SpecHelper
.
temporary_directory
SourcesManager
.
master_repo_functional?
.
should
.
be
.
false
end
end
end
end
spec/unit/target/pod_target_spec.rb
View file @
0684132b
...
...
@@ -209,6 +209,5 @@ module Pod
end
end
end
end
end
spec/unit/target_spec.rb
View file @
0684132b
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../spec_helper', __FILE__)
module
Pod
describe
Target
do
describe
'#c99ext_identifier'
do
before
do
@target
=
Target
.
new
...
...
@@ -15,8 +14,6 @@ module Pod
it
'should mask invalid chars'
do
@target
.
send
(
:c99ext_identifier
,
'iOS-App BânánàLïb'
).
should
==
'iOS_App_B_n_n_L_b'
end
end
end
end
spec/unit/user_interface/error_report_spec.rb
View file @
0684132b
...
...
@@ -104,6 +104,5 @@ EOS
message
.
should
==
'[!] at -'
end
end
end
end
spec/unit/user_interface_spec.rb
View file @
0684132b
...
...
@@ -27,11 +27,9 @@ module Pod
end
describe
'#labeled'
do
it
'prints nothing if value is nil'
do
UI
.
labeled
(
'label'
,
nil
)
UI
.
output
.
should
==
''
end
it
'prints label and value on one line if value is not an array'
do
...
...
@@ -72,7 +70,6 @@ module Pod
UI
.
labeled
(
'label'
,
values
,
12
)
UI
.
output
.
should
==
"
#{
' '
*
10
}
- label:
\n
"
+
values
.
map
{
|
v
|
"
#{
' '
*
12
}
-
#{
v
}
\n
"
}.
join
end
end
end
end
spec/unit/validator_spec.rb
View file @
0684132b
...
...
@@ -15,7 +15,6 @@ end
module
Pod
describe
Validator
do
before
do
Validator
.
any_instance
.
stubs
(
:xcodebuild
).
returns
(
''
)
end
...
...
@@ -96,7 +95,6 @@ module Pod
#-------------------------------------------------------------------------#
describe
'Extensive analysis'
do
describe
'URL validation'
do
before
do
@validator
=
Validator
.
new
(
podspec_path
,
SourcesManager
.
master
.
map
(
&
:url
))
...
...
@@ -416,6 +414,5 @@ module Pod
end
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