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
b255de76
Commit
b255de76
authored
Oct 25, 2012
by
Eloy Durán
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make specs green.
parent
054fe5c8
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
134 additions
and
161 deletions
+134
-161
Gemfile.lock
Gemfile.lock
+1
-1
push.rb
lib/cocoapods/command/push.rb
+1
-1
repo.rb
lib/cocoapods/command/repo.rb
+7
-7
setup.rb
lib/cocoapods/command/setup.rb
+1
-1
spec.rb
lib/cocoapods/command/spec.rb
+3
-1
resolver.rb
lib/cocoapods/resolver.rb
+1
-1
install_spec.rb
spec/functional/command/install_spec.rb
+4
-10
list_spec.rb
spec/functional/command/list_spec.rb
+9
-19
outdated_spec.rb
spec/functional/command/outdated_spec.rb
+5
-4
push_spec.rb
spec/functional/command/push_spec.rb
+11
-11
repo_spec.rb
spec/functional/command/repo_spec.rb
+0
-12
search_spec.rb
spec/functional/command/search_spec.rb
+8
-10
setup_spec.rb
spec/functional/command/setup_spec.rb
+10
-10
spec_spec.rb
spec/functional/command/spec_spec.rb
+27
-28
update_spec.rb
spec/functional/command/update_spec.rb
+5
-4
command_spec.rb
spec/functional/command_spec.rb
+0
-11
spec_helper.rb
spec/spec_helper.rb
+6
-1
command.rb
spec/spec_helper/command.rb
+4
-2
temporary_repos.rb
spec/spec_helper/temporary_repos.rb
+1
-1
command_spec.rb
spec/unit/command_spec.rb
+15
-11
resolver_spec.rb
spec/unit/resolver_spec.rb
+15
-15
No files found.
Gemfile.lock
View file @
b255de76
...
...
@@ -8,7 +8,7 @@ GIT
GIT
remote: git://github.com/alloy/CLAide.git
revision:
fdcc73837ff0c67b440fa9a20dc6366c78f06f09
revision:
324ceaf81365eb6e5936c010037887a2c8d44f3e
specs:
claide (0.0.1)
...
...
lib/cocoapods/command/push.rb
View file @
b255de76
...
...
@@ -89,7 +89,7 @@ module Pod
lint_argv
<<
"--silent"
if
config
.
silent
all_valid
=
true
podspec_files
.
each
do
|
podspec
|
Spec
.
new
(
ARGV
.
new
(
lint_argv
+
[
podspec
.
to_s
])
).
run
Spec
.
parse
(
lint_argv
+
[
podspec
.
to_s
]
).
run
end
end
...
...
lib/cocoapods/command/repo.rb
View file @
b255de76
...
...
@@ -149,17 +149,10 @@ module Pod
# TODO some of the following methods can probably move to one of the subclasses.
protected
def
dir
config
.
repos_dir
+
@name
end
def
print_messages
(
type
,
messages
)
return
if
config
.
silent?
messages
.
each
{
|
msg
|
UI
.
puts
" -
#{
type
.
ljust
(
5
)
}
|
#{
msg
}
"
}
end
def
check_versions
(
dir
)
versions
=
versions
(
dir
)
unless
is_compatilbe
(
versions
)
...
...
@@ -172,6 +165,13 @@ module Pod
UI
.
puts
"
\n
Cocoapods
#{
versions
[
'last'
]
}
is available.
\n
"
.
green
if
has_update
(
versions
)
&&
config
.
new_version_message?
end
protected
def
print_messages
(
type
,
messages
)
return
if
config
.
silent?
messages
.
each
{
|
msg
|
UI
.
puts
" -
#{
type
.
ljust
(
5
)
}
|
#{
msg
}
"
}
end
def
self
.
compatible?
(
name
)
dir
=
Config
.
instance
.
repos_dir
+
name
versions
=
versions
(
dir
)
...
...
lib/cocoapods/command/setup.rb
View file @
b255de76
...
...
@@ -69,7 +69,7 @@ module Pod
end
def
add_master_repo
@command
||=
Repo
.
new
(
ARGV
.
new
([
'add'
,
'master'
,
url
,
'master'
])
).
run
@command
||=
Repo
::
Add
.
parse
([
'master'
,
url
,
'master'
]
).
run
end
def
update_master_repo
...
...
lib/cocoapods/command/spec.rb
View file @
b255de76
...
...
@@ -5,6 +5,8 @@ require 'active_support/core_ext/string/inflections'
module
Pod
class
Command
class
Spec
<
Command
self
.
abstract_command
=
true
self
.
summary
=
'Manage pod specs'
class
Create
<
Spec
...
...
@@ -18,7 +20,7 @@ module Pod
self
.
arguments
=
'[ NAME | https://github.com/USER/REPO ]'
def
initialize
(
argv
)
@
url
,
@name_or_
url
=
argv
.
shift_argument
,
argv
.
shift_argument
@
name_or_url
,
@
url
=
argv
.
shift_argument
,
argv
.
shift_argument
super
end
...
...
lib/cocoapods/resolver.rb
View file @
b255de76
...
...
@@ -82,7 +82,7 @@ module Pod
unless
config
.
skip_repo_update?
UI
.
section
'Updating spec repositories'
do
Command
::
Repo
.
new
(
Command
::
ARGV
.
new
([
"update"
])
).
run
Command
::
Repo
::
Update
.
parse
([]
).
run
end
if
!
@lockfile
||
!
(
@pods_by_state
[
:added
]
+
@pods_by_state
[
:changed
]).
empty?
||
update_mode
end
...
...
spec/functional/command/install_spec.rb
View file @
b255de76
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
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
Pod
::
Command
::
Install
.
banner
.
should
.
match
%r{xcodeproj 'path/to/XcodeProject'}
end
module
Pod
describe
Command
::
Install
do
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
=
lambda
{
run_command
(
'install'
,
'--no-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the current working directory."
end
end
end
spec/functional/command/list_spec.rb
View file @
b255de76
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
"Pod::Command::List"
do
module
Pod
describe
Command
::
List
do
extend
SpecHelper
::
TemporaryRepos
def
command
(
arguments
=
argv
)
command
=
Pod
::
Command
::
List
.
new
(
arguments
)
end
it
"complains for wrong parameters"
do
lambda
{
command
(
argv
(
'wrong'
)).
run
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
command
(
argv
(
'--wrong'
)).
run
}.
should
.
raise
Pod
::
Command
::
Help
end
it
"presents the known pods"
do
list
=
command
()
list
.
run
it
"lists the known pods"
do
out
=
run_command
(
'list'
)
[
/ZBarSDK/
,
/TouchJSON/
,
/SDURLCache/
,
/MagicalRecord/
,
/A2DynamicDelegate/
,
/\d+ pods were found/
].
each
{
|
regex
|
Pod
::
UI
.
outp
ut
.
should
=~
regex
}
].
each
{
|
regex
|
o
ut
.
should
=~
regex
}
end
it
"return
s the new pods"
do
it
"list
s the new pods"
do
Time
.
stubs
(
:now
).
returns
(
Time
.
mktime
(
2012
,
2
,
3
))
list
=
command
(
argv
(
'new'
))
list
.
run
out
=
run_command
(
'list'
,
'new'
)
[
'iCarousel'
,
'libPusher'
,
'SSCheckBoxView'
,
...
...
@@ -36,8 +26,8 @@ describe "Pod::Command::List" do
'FileMD5Hash'
,
'cocoa-oauth'
,
'iRate'
].
each
{
|
s
|
Pod
::
UI
.
output
.
should
.
include
s
}
].
each
{
|
s
|
out
.
should
.
include
s
}
end
end
end
spec/functional/command/outdated_spec.rb
View file @
b255de76
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
Pod
::
Command
::
Outdated
do
extend
SpecHelper
::
Command
module
Pod
describe
Command
::
Outdated
do
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
it
"tells the user that no Podfile was found in the current working dir"
do
exception
=
lambda
{
run_command
(
'outdated'
,
'--no-update'
)
}.
should
.
raise
Pod
::
Informative
exception
=
lambda
{
run_command
(
'outdated'
,
'--no-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the current working directory."
end
...
...
@@ -14,9 +14,10 @@ describe Pod::Command::Outdated do
file
=
temporary_directory
+
'Podfile'
File
.
open
(
file
,
'w'
)
{
|
f
|
f
.
write
(
'platform :ios'
)
}
Dir
.
chdir
(
temporary_directory
)
do
exception
=
lambda
{
run_command
(
'outdated'
,
'--no-update'
)
}.
should
.
raise
Pod
::
Informative
exception
=
lambda
{
run_command
(
'outdated'
,
'--no-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile.lock' found in the current working directory"
end
end
end
end
spec/functional/command/push_spec.rb
View file @
b255de76
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
Pod
::
Command
::
Push
do
module
Pod
describe
Command
::
Push
do
extend
SpecHelper
::
Command
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
...
...
@@ -13,22 +14,20 @@ describe Pod::Command::Push do
fixture
(
'spec-repos/master'
)
end
it
"complains for wrong parameters"
do
lambda
{
run_command
(
'push'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'push'
,
'--allow-warnings'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'push'
,
'--wrong-option'
)
}.
should
.
raise
Pod
::
Command
::
Help
it
"requires a spec-repo name"
do
lambda
{
command
(
'push'
).
validate!
}.
should
.
raise
Command
::
Help
end
it
"complains if it can't find the repo"
do
repo1
=
add_repo
(
'repo1'
,
master_repo
)
Dir
.
chdir
(
fixture
(
'banana-lib'
))
do
lambda
{
run_command
(
'push'
,
'repo2'
)
}.
should
.
raise
Pod
::
Informative
lambda
{
run_command
(
'push'
,
'repo2'
)
}.
should
.
raise
Informative
end
end
it
"complains if it can't find a spec"
do
repo1
=
add_repo
(
'repo1'
,
master_repo
)
lambda
{
run_command
(
'push'
,
'repo1'
)
}.
should
.
raise
Pod
::
Informative
lambda
{
run_command
(
'push'
,
'repo1'
)
}.
should
.
raise
Informative
end
it
"it raises if the pod is not validated"
do
...
...
@@ -36,7 +35,7 @@ describe Pod::Command::Push do
repo2
=
add_repo
(
'repo2'
,
repo1
.
dir
)
git_config
(
'repo2'
,
'remote.origin.url'
).
should
==
(
tmp_repos_path
+
'repo1'
).
to_s
Dir
.
chdir
(
fixture
(
'banana-lib'
))
do
lambda
{
command
(
'push'
,
'repo2'
,
'--silent'
).
run
}.
should
.
raise
Pod
::
Informative
lambda
{
run_command
(
'push'
,
'repo2'
,
'--silent'
)
}.
should
.
raise
Informative
end
# (repo1.dir + 'BananaLib/1.0/BananaLib.podspec').read.should.include 'Added!'
end
...
...
@@ -60,7 +59,7 @@ describe Pod::Command::Push do
(
@local_repo
.
dir
+
'README'
).
read
.
should
.
include
'Added!'
cmd
=
command
(
'push'
,
'local_repo'
)
cmd
.
expects
(
:validate_podspec_files
).
returns
(
true
)
Dir
.
chdir
(
temporary_directory
)
{
lambda
{
cmd
.
run
}.
should
.
raise
Pod
::
Informative
}
Dir
.
chdir
(
temporary_directory
)
{
lambda
{
cmd
.
run
}.
should
.
raise
Informative
}
(
@upstream
.
dir
+
'PushTest/1.4/PushTest.podspec'
).
should
.
not
.
exist?
end
...
...
@@ -71,10 +70,11 @@ describe Pod::Command::Push do
cmd
.
expects
(
:validate_podspec_files
).
returns
(
true
)
Dir
.
chdir
(
temporary_directory
)
{
cmd
.
run
}
Pod
::
UI
.
output
.
should
.
include
(
'[Add] PushTest (1.4)'
)
Pod
::
UI
.
output
.
should
.
include
(
'[Fix] JSONKit (1.4)'
)
UI
.
output
.
should
.
include
(
'[Add] PushTest (1.4)'
)
UI
.
output
.
should
.
include
(
'[Fix] JSONKit (1.4)'
)
git
(
'upstream'
,
'checkout test'
)
# checkout because test because is it the branch used in the specs.
(
@upstream
.
dir
+
'PushTest/1.4/PushTest.podspec'
).
read
.
should
.
include
(
'PushTest'
)
end
end
end
spec/functional/command/repo_spec.rb
View file @
b255de76
...
...
@@ -7,20 +7,9 @@ describe "Pod::Command::Repo" do
end
describe
"In general"
do
extend
SpecHelper
::
Command
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
it
"runs with correct parameters"
do
lambda
{
run_command
(
'repo'
,
'update'
)
}.
should
.
not
.
raise
lambda
{
run_command
(
'repo'
,
'lint'
,
temporary_directory
.
to_s
)
}.
should
.
not
.
raise
end
it
"complains for wrong parameters"
do
lambda
{
run_command
(
'repo'
,
'add'
)
}.
should
.
raise
Pod
::
Informative
lambda
{
run_command
(
'repo'
,
'add'
,
'NAME'
)
}.
should
.
raise
Pod
::
Informative
end
it
"adds a spec-repo"
do
run_command
(
'repo'
,
'add'
,
'private'
,
fixture
(
'spec-repos/master'
))
git_config
(
'private'
,
'remote.origin.url'
).
should
==
fixture
(
'spec-repos/master'
).
to_s
...
...
@@ -67,7 +56,6 @@ describe "Pod::Command::Repo" do
end
describe
"Concerning a repo support"
do
extend
SpecHelper
::
Command
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
...
...
spec/functional/command/search_spec.rb
View file @
b255de76
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
"Pod::Command::Search"
do
extend
SpecHelper
::
Command
module
Pod
describe
Command
::
Search
do
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
...
...
@@ -15,10 +15,10 @@ describe "Pod::Command::Search" do
end
it
"complains for wrong parameters"
do
lambda
{
run_command
(
'search'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'search'
,
'too'
,
'many'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'search'
,
'too'
,
'--wrong'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'search'
,
'--wrong'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'search'
)
}.
should
.
raise
Command
::
Help
lambda
{
run_command
(
'search'
,
'too'
,
'many'
)
}.
should
.
raise
Command
::
Help
lambda
{
run_command
(
'search'
,
'too'
,
'--wrong'
)
}.
should
.
raise
Command
::
Help
lambda
{
run_command
(
'search'
,
'--wrong'
)
}.
should
.
raise
Command
::
Help
end
it
"presents the search results"
do
...
...
@@ -42,11 +42,9 @@ describe "Pod::Command::Search" do
[
'is'
,
%w{ ASIHTTPRequest SSZipArchive }
],
[
'luke redpath'
,
%w{ Kiwi libPusher LRMocky LRResty LRTableModel}
],
].
each
do
|
query
,
results
|
output
=
run_command
(
'search'
,
'--full'
,
query
)
output
=
run_command
(
'search'
,
query
,
'--full'
)
results
.
each
{
|
pod
|
output
.
should
.
include?
pod
}
end
end
end
end
spec/functional/command/setup_spec.rb
View file @
b255de76
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
"Pod::Command::Setup"
do
extend
SpecHelper
::
Command
module
Pod
describe
Command
::
Setup
do
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
...
...
@@ -15,22 +14,22 @@ describe "Pod::Command::Setup" do
end
it
"complains for wrong parameters"
do
lambda
{
run_command
(
'setup'
,
'wrong'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'setup'
,
'--wrong'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'setup'
,
'wrong'
)
}.
should
.
raise
Command
::
Help
lambda
{
run_command
(
'setup'
,
'--wrong'
)
}.
should
.
raise
Command
::
Help
end
it
"returns the read only URL of the `master' spec-repo"
do
cmd
=
Pod
::
Command
::
Setup
.
new
(
argv
)
cmd
=
Command
::
Setup
.
new
(
argv
)
cmd
.
url
.
should
==
'https://github.com/CocoaPods/Specs.git'
end
it
"returns the push URL of the `master' spec-repo"
do
config
.
silent
=
true
cmd
=
Pod
::
Command
::
Setup
.
new
(
argv
(
'--push'
))
cmd
=
Command
::
Setup
.
new
(
argv
(
'--push'
))
cmd
.
url
.
should
==
'git@github.com:CocoaPods/Specs.git'
end
class
Pod
::
Command
::
Setup
class
Command
::
Setup
def
read_only_url
;
SpecHelper
.
fixture
(
'spec-repos/master'
);
end
end
...
...
@@ -51,8 +50,9 @@ describe "Pod::Command::Setup" do
it
"can run if needed"
do
output
=
run_command
(
'setup'
)
output
.
should
.
include
"Setup completed"
Pod
::
UI
.
output
=
''
UI
.
output
=
''
command
(
'setup'
).
run_if_needed
Pod
::
UI
.
output
.
should
==
''
UI
.
output
.
should
==
''
end
end
end
spec/functional/command/spec_spec.rb
View file @
b255de76
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
Pod
::
Command
::
Spec
do
extend
SpecHelper
::
Command
module
Pod
describe
Command
::
Spec
do
extend
SpecHelper
::
TemporaryDirectory
it
"complains for wrong parameters"
do
lambda
{
run_command
(
'spec'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'spec'
,
'create'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'spec'
,
'--create'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'spec'
,
'NAME'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'spec'
,
'createa'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'lint'
,
'agument1'
,
'2'
)
}.
should
.
raise
Pod
::
Command
::
Help
lambda
{
run_command
(
'spec'
)
}.
should
.
raise
Command
::
Help
lambda
{
run_command
(
'spec'
,
'create'
)
}.
should
.
raise
Command
::
Help
lambda
{
run_command
(
'spec'
,
'--create'
)
}.
should
.
raise
Command
::
Help
lambda
{
run_command
(
'spec'
,
'NAME'
)
}.
should
.
raise
Command
::
Help
lambda
{
run_command
(
'spec'
,
'createa'
)
}.
should
.
raise
Command
::
Help
lambda
{
run_command
(
'lint'
,
'agument1'
,
'2'
)
}.
should
.
raise
Command
::
Help
end
end
end
describe
"Pod::Command::Spec#create"
do
extend
SpecHelper
::
Command
describe
"Command::Spec#create"
do
extend
SpecHelper
::
Github
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
...
...
@@ -23,11 +22,11 @@ describe "Pod::Command::Spec#create" do
it
"creates a new podspec stub file"
do
run_command
(
'spec'
,
'create'
,
'Bananas'
)
path
=
temporary_directory
+
'Bananas.podspec'
spec
=
Pod
::
Specification
.
from_file
(
path
).
activate_platform
(
:ios
)
spec
=
Specification
.
from_file
(
path
).
activate_platform
(
:ios
)
spec
.
name
.
should
==
'Bananas'
spec
.
license
.
should
==
{
:type
=>
"MIT (example)"
}
spec
.
version
.
should
==
Pod
::
Version
.
new
(
'0.0.1'
)
spec
.
version
.
should
==
Version
.
new
(
'0.0.1'
)
spec
.
summary
.
should
==
'A short description of Bananas.'
spec
.
homepage
.
should
==
'http://EXAMPLE/Bananas'
spec
.
authors
.
should
==
{
`git config --get user.name`
.
strip
=>
`git config --get user.email`
.
strip
}
...
...
@@ -43,10 +42,10 @@ describe "Pod::Command::Spec#create" do
expect_github_tags_request
run_command
(
'spec'
,
'create'
,
'https://github.com/lukeredpath/libPusher.git'
)
path
=
temporary_directory
+
'libPusher.podspec'
spec
=
Pod
::
Specification
.
from_file
(
path
)
spec
=
Specification
.
from_file
(
path
)
spec
.
name
.
should
==
'libPusher'
spec
.
license
.
should
==
{
:type
=>
"MIT (example)"
}
spec
.
version
.
should
==
Pod
::
Version
.
new
(
'1.3'
)
spec
.
version
.
should
==
Version
.
new
(
'1.3'
)
spec
.
summary
.
should
==
'An Objective-C interface to Pusher (pusherapp.com)'
spec
.
homepage
.
should
==
'https://github.com/lukeredpath/libPusher'
spec
.
authors
.
should
==
{
"Luke Redpath"
=>
"luke@lukeredpath.co.uk"
}
...
...
@@ -59,10 +58,10 @@ describe "Pod::Command::Spec#create" do
expect_github_tags_request
run_command
(
'spec'
,
'create'
,
'other_name'
,
'https://github.com/lukeredpath/libPusher.git'
)
path
=
temporary_directory
+
'other_name.podspec'
spec
=
Pod
::
Specification
.
from_file
(
path
)
spec
=
Specification
.
from_file
(
path
)
spec
.
name
.
should
==
'other_name'
spec
.
license
.
should
==
{
:type
=>
"MIT (example)"
}
spec
.
version
.
should
==
Pod
::
Version
.
new
(
'1.3'
)
spec
.
version
.
should
==
Version
.
new
(
'1.3'
)
spec
.
summary
.
should
==
'An Objective-C interface to Pusher (pusherapp.com)'
spec
.
homepage
.
should
==
'https://github.com/lukeredpath/libPusher'
spec
.
authors
.
should
==
{
"Luke Redpath"
=>
"luke@lukeredpath.co.uk"
}
...
...
@@ -76,8 +75,8 @@ describe "Pod::Command::Spec#create" do
expect_github_branches_request
run_command
(
'spec'
,
'create'
,
'https://github.com/lukeredpath/libPusher.git'
)
path
=
temporary_directory
+
'libPusher.podspec'
spec
=
Pod
::
Specification
.
from_file
(
path
)
spec
.
version
.
should
==
Pod
::
Version
.
new
(
'0.0.1'
)
spec
=
Specification
.
from_file
(
path
)
spec
.
version
.
should
==
Version
.
new
(
'0.0.1'
)
spec
.
source
.
should
==
{
:git
=>
'https://github.com/lukeredpath/libPusher.git'
,
:commit
=>
'5f482b0693ac2ac1ad85d1aabc27ec7547cc0bc7'
}
end
...
...
@@ -90,16 +89,15 @@ describe "Pod::Command::Spec#create" do
output
.
should
.
include
'MARKDOWN TEMPLATE'
output
.
should
.
include
'Please add semantic version tags'
end
end
end
describe
"Pod::Command::Spec#lint"
do
extend
SpecHelper
::
Command
describe
"Command::Spec#lint"
do
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
it
"complains if it can't find any spec to lint"
do
Dir
.
chdir
(
temporary_directory
)
do
lambda
{
command
(
'spec'
,
'lint'
).
run
}.
should
.
raise
Pod
::
Informative
lambda
{
command
(
'spec'
,
'lint'
).
run
}.
should
.
raise
Informative
end
end
...
...
@@ -107,7 +105,7 @@ describe "Pod::Command::Spec#lint" do
Dir
.
chdir
(
fixture
(
'spec-repos'
)
+
'master/JSONKit/1.4/'
)
do
cmd
=
command
(
'spec'
,
'lint'
,
'--quick'
,
'--only-errors'
)
cmd
.
run
Pod
::
UI
.
output
.
should
.
include
"passed validation"
UI
.
output
.
should
.
include
"passed validation"
end
end
...
...
@@ -126,15 +124,16 @@ describe "Pod::Command::Spec#lint" do
@spec_path
=
file
.
to_s
end
it
"lints a givent
podspec"
do
it
"lints a given
podspec"
do
cmd
=
command
(
'spec'
,
'lint'
,
'--quick'
,
@spec_path
)
lambda
{
cmd
.
run
}.
should
.
raise
Pod
::
Informative
Pod
::
UI
.
output
.
should
.
include
"Missing license type"
lambda
{
cmd
.
run
}.
should
.
raise
Informative
UI
.
output
.
should
.
include
"Missing license type"
end
it
"respects the -only--errors option"
do
cmd
=
command
(
'spec'
,
'lint'
,
'--quick'
,
'--only-errors'
,
@spec_path
)
lambda
{
cmd
.
run
}.
should
.
not
.
raise
Pod
::
UI
.
output
.
should
.
include
"Missing license type"
UI
.
output
.
should
.
include
"Missing license type"
end
end
end
spec/functional/command/update_spec.rb
View file @
b255de76
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
Pod
::
Command
::
Update
do
extend
SpecHelper
::
Command
module
Pod
describe
Command
::
Update
do
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
it
"tells the user that no Podfile was found in the current working dir"
do
exception
=
lambda
{
run_command
(
'update'
,
'--no-update'
)
}.
should
.
raise
Pod
::
Informative
exception
=
lambda
{
run_command
(
'update'
,
'--no-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the current working directory."
end
...
...
@@ -14,9 +14,10 @@ describe Pod::Command::Update do
file
=
temporary_directory
+
'Podfile'
File
.
open
(
file
,
'w'
)
{
|
f
|
f
.
write
(
'platform :ios'
)
}
Dir
.
chdir
(
temporary_directory
)
do
exception
=
lambda
{
run_command
(
'update'
,
'--no-update'
)
}.
should
.
raise
Pod
::
Informative
exception
=
lambda
{
run_command
(
'update'
,
'--no-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile.lock' found in the current working directory"
end
end
end
end
spec/functional/command_spec.rb
deleted
100644 → 0
View file @
054fe5c8
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
# describe "Pod::Command" do
# extend SpecHelper::Command
# extend SpecHelper::TemporaryDirectory
# extend SpecHelper::TemporaryRepos
#
# TODO:
# it "raises help informative if an unknown parameter is passed"
# it "performs setup if needed"
# end
spec/spec_helper.rb
View file @
b255de76
...
...
@@ -21,13 +21,18 @@ require 'spec_helper/temporary_repos'
require
'spec_helper/user_interface'
require
'spec_helper/pre_flight'
ENV
[
'SKIP_SETUP'
]
=
'true'
require
'claide'
module
Bacon
class
Context
include
Pod
::
Config
::
Mixin
include
SpecHelper
::
Fixture
include
SpecHelper
::
Command
def
argv
(
*
argv
)
Pod
::
Command
::
ARGV
.
new
(
argv
)
CLAide
::
ARGV
.
new
(
argv
)
end
end
end
...
...
spec/spec_helper/command.rb
View file @
b255de76
...
...
@@ -4,7 +4,7 @@ module SpecHelper
module
Command
def
command
(
*
argv
)
argv
<<
'--no-color'
Pod
::
Command
.
parse
(
*
argv
)
Pod
::
Command
.
parse
(
argv
)
end
def
run_command
(
*
args
)
...
...
@@ -14,7 +14,9 @@ module SpecHelper
# been converted to use the UI.puts
config_silent
=
config
.
silent?
config
.
silent
=
false
command
(
*
args
).
run
cmd
=
command
(
*
args
)
cmd
.
validate!
cmd
.
run
config
.
silent
=
config_silent
Pod
::
UI
.
output
end
...
...
spec/spec_helper/temporary_repos.rb
View file @
b255de76
...
...
@@ -28,7 +28,7 @@ module SpecHelper
end
def
add_repo
(
name
,
from
)
command
=
command
(
'repo'
,
'add'
,
name
,
from
)
command
=
Pod
::
Command
.
parse
([
'repo'
,
'add'
,
name
,
from
]
)
command
.
run
# The test branch is used by the push specs
Dir
.
chdir
(
command
.
dir
)
do
...
...
spec/unit/command_spec.rb
View file @
b255de76
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
describe
"Pod::Command"
do
module
Pod
describe
Command
do
it
"returns the proper command class"
do
Pod
::
Command
.
parse
(
'setup'
).
should
.
be
.
instance_of
Pod
::
Command
::
Setup
Pod
::
Command
.
parse
(
'spec'
,
'create'
,
'name'
).
should
.
be
.
instance_of
Pod
::
Command
::
Spec
Pod
::
Command
.
parse
(
'repo'
,
'update'
).
should
.
be
.
instance_of
Pod
::
Command
::
Repo
Command
.
parse
(
%w{ install }
).
should
.
be
.
instance_of
Command
::
Install
Command
.
parse
(
%w{ list }
).
should
.
be
.
instance_of
Command
::
List
Command
.
parse
(
%w{ outdated }
).
should
.
be
.
instance_of
Command
::
Outdated
Command
.
parse
(
%w{ push }
).
should
.
be
.
instance_of
Command
::
Push
Command
.
parse
(
%w{ repo }
).
should
.
be
.
instance_of
Command
::
Repo
Command
.
parse
(
%w{ repo add }
).
should
.
be
.
instance_of
Command
::
Repo
::
Add
Command
.
parse
(
%w{ repo lint }
).
should
.
be
.
instance_of
Command
::
Repo
::
Lint
Command
.
parse
(
%w{ repo update }
).
should
.
be
.
instance_of
Command
::
Repo
::
Update
Command
.
parse
(
%w{ search }
).
should
.
be
.
instance_of
Command
::
Search
Command
.
parse
(
%w{ setup }
).
should
.
be
.
instance_of
Command
::
Setup
Command
.
parse
(
%w{ spec create }
).
should
.
be
.
instance_of
Command
::
Spec
::
Create
Command
.
parse
(
%w{ spec lint }
).
should
.
be
.
instance_of
Command
::
Spec
::
Lint
Command
.
parse
(
%w{ repo update }
).
should
.
be
.
instance_of
Command
::
Repo
::
Update
end
end
describe
"Pod::Command::Repo"
do
it
"complains about unknown arguments"
do
lambda
{
Pod
::
Command
::
Repo
.
new
(
argv
(
'something'
))
}.
should
.
raise
Pod
::
Command
::
Help
end
end
spec/unit/resolver_spec.rb
View file @
b255de76
...
...
@@ -14,9 +14,9 @@ module Pod
it
"holds the context state, such as cached specification sets"
do
@resolver
.
resolve
@resolver
.
cached_sets
.
values
.
sort_by
(
&
:name
).
should
==
[
Pod
::
Source
.
search_by_name
(
'A2DynamicDelegate'
).
first
,
Pod
::
Source
.
search_by_name
(
'BlocksKit'
).
first
,
Pod
::
Source
.
search_by_name
(
'libffi'
).
first
Source
.
search_by_name
(
'A2DynamicDelegate'
).
first
,
Source
.
search_by_name
(
'BlocksKit'
).
first
,
Source
.
search_by_name
(
'libffi'
).
first
].
sort_by
(
&
:name
)
end
...
...
@@ -34,7 +34,7 @@ module Pod
end
it
"raises once any of the dependencies does not match the platform of its podfile target"
do
set
=
Pod
::
Source
.
search_by_name
(
'BlocksKit'
).
first
set
=
Source
.
search_by_name
(
'BlocksKit'
).
first
@resolver
.
cached_sets
[
'BlocksKit'
]
=
set
def
set
.
stub_platform
=
(
platform
);
@stubbed_platform
=
platform
;
end
...
...
@@ -54,7 +54,7 @@ module Pod
end
it
"raises once any of the dependencies does not have a deployment_target compatible with its podfile target"
do
set
=
Pod
::
Source
.
search_by_name
(
'BlocksKit'
).
first
set
=
Source
.
search_by_name
(
'BlocksKit'
).
first
@resolver
.
cached_sets
[
'BlocksKit'
]
=
set
@podfile
.
platform
:ios
,
"4.0"
...
...
@@ -200,7 +200,7 @@ module Pod
pod
'JSONKit'
,
"1.5pre"
end
resolver
=
Resolver
.
new
(
podfile
,
nil
,
stub
(
'sandbox'
))
lambda
{
resolver
.
resolve
}.
should
.
raise
Pod
::
Informative
lambda
{
resolver
.
resolve
}.
should
.
raise
Informative
end
describe
"Concerning Installation mode"
do
...
...
@@ -212,11 +212,11 @@ module Pod
pod
'JSONKit'
end
@specs
=
[
Pod
::
Specification
.
new
do
|
s
|
Specification
.
new
do
|
s
|
s
.
name
=
"BlocksKit"
s
.
version
=
"1.0.0"
end
,
Pod
::
Specification
.
new
do
|
s
|
Specification
.
new
do
|
s
|
s
.
name
=
"JSONKit"
s
.
version
=
"1.4"
end
]
...
...
@@ -300,7 +300,7 @@ module Pod
pod
'JSONKit'
end
config
.
skip_repo_update
=
false
Pod
::
Command
::
Repo
.
any_instance
.
expects
(
:run
).
never
Command
::
Repo
.
any_instance
.
expects
(
:run
).
never
@resolver
=
Resolver
.
new
(
podfile
,
@lockfile
,
stub
(
'sandbox'
))
@resolver
.
resolve
end
...
...
@@ -313,7 +313,7 @@ module Pod
pod
'libPusher'
# New pod
end
config
.
skip_repo_update
=
false
Pod
::
Command
::
Repo
.
any_instance
.
expects
(
:run
).
once
Command
::
Repo
::
Update
.
any_instance
.
expects
(
:run
).
once
@resolver
=
Resolver
.
new
(
podfile
,
@lockfile
,
stub
(
'sandbox'
))
@resolver
.
resolve
end
...
...
@@ -326,7 +326,7 @@ module Pod
pod
'libPusher'
# New pod
end
config
.
skip_repo_update
=
true
Pod
::
Command
::
Repo
.
any_instance
.
expects
(
:run
).
never
Command
::
Repo
::
Update
.
any_instance
.
expects
(
:run
).
never
@resolver
=
Resolver
.
new
(
podfile
,
@lockfile
,
stub
(
'sandbox'
))
@resolver
.
resolve
end
...
...
@@ -338,7 +338,7 @@ module Pod
pod
'JSONKit'
,
:head
#changed to head
end
config
.
skip_repo_update
=
false
Pod
::
Command
::
Repo
.
any_instance
.
expects
(
:run
).
once
Command
::
Repo
::
Update
.
any_instance
.
expects
(
:run
).
once
@resolver
=
Resolver
.
new
(
podfile
,
@lockfile
,
stub
(
'sandbox'
))
@resolver
.
resolve
end
...
...
@@ -354,11 +354,11 @@ module Pod
pod
'libPusher'
end
@specs
=
[
Pod
::
Specification
.
new
do
|
s
|
Specification
.
new
do
|
s
|
s
.
name
=
"libPusher"
s
.
version
=
"1.3"
end
,
Pod
::
Specification
.
new
do
|
s
|
Specification
.
new
do
|
s
|
s
.
name
=
"JSONKit"
s
.
version
=
"1.4"
end
]
...
...
@@ -411,7 +411,7 @@ module Pod
pod
'libPusher'
end
config
.
skip_repo_update
=
false
Pod
::
Command
::
Repo
.
any_instance
.
expects
(
:run
).
once
Command
::
Repo
::
Update
.
any_instance
.
expects
(
:run
).
once
@resolver
=
Resolver
.
new
(
podfile
,
@lockfile
,
stub
(
'sandbox'
))
@resolver
.
update_mode
=
true
@resolver
.
resolve
...
...
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