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
dcd537a5
Commit
dcd537a5
authored
Sep 14, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix command unit specs.
parent
b64c0c1f
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
26 deletions
+33
-26
repo.rb
lib/cocoa_pods/command/repo.rb
+2
-2
config.rb
lib/cocoa_pods/config.rb
+5
-1
installer.rb
lib/cocoa_pods/installer.rb
+3
-1
specification.rb
lib/cocoa_pods/specification.rb
+3
-3
spec_helper.rb
spec/spec_helper.rb
+7
-1
command_spec.rb
spec/unit/command_spec.rb
+7
-16
config_spec.rb
spec/unit/config_spec.rb
+6
-2
No files found.
lib/cocoa_pods/command/repo.rb
View file @
dcd537a5
...
...
@@ -48,7 +48,7 @@ module Pod
end
def
add
puts
"==> Cloning spec repo `
#{
@name
}
' from `
#{
@url
}
'"
puts
"==> Cloning spec repo `
#{
@name
}
' from `
#{
@url
}
'"
unless
config
.
silent?
config
.
repos_dir
.
mkpath
Dir
.
chdir
(
config
.
repos_dir
)
{
git
(
"clone
#{
@url
}
#{
@name
}
"
)
}
end
...
...
@@ -56,7 +56,7 @@ module Pod
def
update
dirs
=
@name
?
[
dir
]
:
config
.
repos_dir
.
children
dirs
.
each
do
|
dir
|
puts
"==> Updating spec repo `
#{
dir
.
basename
}
'"
puts
"==> Updating spec repo `
#{
dir
.
basename
}
'"
unless
config
.
silent?
Dir
.
chdir
(
dir
)
{
git
(
"pull"
)
}
end
end
...
...
lib/cocoa_pods/config.rb
View file @
dcd537a5
...
...
@@ -10,12 +10,16 @@ module Pod
@instance
=
instance
end
attr_accessor
:repos_dir
,
:clean
,
:verbose
attr_accessor
:repos_dir
,
:clean
,
:verbose
,
:silent
alias_method
:clean?
,
:clean
alias_method
:verbose?
,
:verbose
alias_method
:silent?
,
:silent
def
initialize
@repos_dir
=
Pathname
.
new
(
File
.
expand_path
(
"~/.cocoa-pods"
))
@clean
=
true
@verbose
=
false
@silent
=
false
end
def
project_root
...
...
lib/cocoa_pods/installer.rb
View file @
dcd537a5
...
...
@@ -24,7 +24,9 @@ module Pod
end
def
install!
unless
config
.
silent?
puts
"Installing dependencies defined in:
#{
@top_level_specification
.
defined_in_file
}
"
end
install_dependent_specifications!
generate_project
write_files!
...
...
@@ -40,7 +42,7 @@ module Pod
end
def
generate_project
puts
"==> Creating Pods project files"
puts
"==> Creating Pods project files"
unless
config
.
silent?
dependent_specification_sets
.
each
do
|
set
|
# In case the set is only part of other pods we don't need to build
# the pod itself.
...
...
lib/cocoa_pods/specification.rb
View file @
dcd537a5
...
...
@@ -145,7 +145,7 @@ module Pod
# end
# end
def
install!
puts
"==> Installing:
#{
self
}
"
puts
"==> Installing:
#{
self
}
"
unless
config
.
silent?
config
.
project_pods_root
.
mkpath
require
'fileutils'
FileUtils
.
cp
(
@defined_in_file
,
config
.
project_pods_root
)
...
...
@@ -157,9 +157,9 @@ module Pod
def
download_if_necessary!
if
pod_destroot
.
exist?
puts
" * Skipping download of
#{
self
}
, pod already downloaded"
puts
" * Skipping download of
#{
self
}
, pod already downloaded"
unless
config
.
silent?
else
puts
" * Downloading:
#{
self
}
"
puts
" * Downloading:
#{
self
}
"
unless
config
.
silent?
download!
end
end
...
...
spec/spec_helper.rb
View file @
dcd537a5
...
...
@@ -20,6 +20,12 @@ class Bacon::Context
include
Pod
::
Config
::
Mixin
include
SpecHelper
::
Fixture
def
argv
(
*
argv
)
Pod
::
Command
::
ARGV
.
new
(
argv
)
end
end
Pod
::
Config
.
instance
.
repos_dir
=
SpecHelper
.
tmp_repos_path
config
=
Pod
::
Config
.
instance
config
.
silent
=
true
config
.
repos_dir
=
SpecHelper
.
tmp_repos_path
spec/unit/command_spec.rb
View file @
dcd537a5
...
...
@@ -2,34 +2,25 @@ require File.expand_path('../../spec_helper', __FILE__)
describe
"Pod::Command"
do
it
"returns the proper command class"
do
Pod
::
Command
.
parse
(
"help"
).
should
.
be
.
instance_of
Pod
::
Command
::
Help
Pod
::
Command
.
parse
(
"setup"
).
should
.
be
.
instance_of
Pod
::
Command
::
Setup
Pod
::
Command
.
parse
(
"spec"
).
should
.
be
.
instance_of
Pod
::
Command
::
Spec
Pod
::
Command
.
parse
(
"repo"
).
should
.
be
.
instance_of
Pod
::
Command
::
Repo
Pod
::
Command
.
parse
(
'setup'
).
should
.
be
.
instance_of
Pod
::
Command
::
Setup
#Pod::Command.parse('spec').should.be.instance_of Pod::Command::Spec
Pod
::
Command
.
parse
(
'repo'
,
'update'
).
should
.
be
.
instance_of
Pod
::
Command
::
Repo
end
end
describe
"Pod::Command::Setup"
do
it
"complains about unknown arguments"
do
lambda
{
Pod
::
Command
::
Setup
.
new
(
'something'
)
}.
should
.
raise
ArgumentError
end
before
do
@command
=
Pod
::
Command
::
Setup
.
new
lambda
{
Pod
::
Command
::
Setup
.
new
(
argv
(
'something'
))
}.
should
.
raise
Pod
::
Command
::
Help
end
it
"returns the URL of the `master' spec-repo"
do
@command
.
master_repo_url
.
should
==
'git://github.com/alloy/cocoa-pod-specs.git'
command
=
Pod
::
Command
::
Setup
.
new
(
argv
)
command
.
master_repo_url
.
should
==
'git://github.com/alloy/cocoa-pod-specs.git'
end
end
describe
"Pod::Command::Repo"
do
it
"complains about unknown arguments"
do
lambda
{
Pod
::
Command
::
Repo
.
new
(
'something'
)
}.
should
.
raise
ArgumentError
end
it
"returns the path of the spec-repo directory"
do
repo
=
Pod
::
Command
::
Repo
.
new
(
'cd'
,
'private'
)
repo
.
dir
.
should
==
File
.
join
(
config
.
repos_dir
,
'private'
)
lambda
{
Pod
::
Command
::
Repo
.
new
(
argv
(
'something'
))
}.
should
.
raise
Pod
::
Command
::
Help
end
end
spec/unit/config_spec.rb
View file @
dcd537a5
...
...
@@ -33,12 +33,16 @@ describe "Pod::Config" do
end
describe
"concerning default settings"
do
it
"prints out normal information"
do
config
.
should
.
not
.
be
.
silent
end
it
"does not print vebose information"
do
config
.
verbose
.
should
==
fal
se
config
.
should
.
not
.
be
.
verbo
se
end
it
"cleans SCM dirs in dependency checkouts"
do
config
.
clean
.
should
==
true
config
.
should
.
clean
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