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
c9092041
Commit
c9092041
authored
Mar 14, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Spec Command::Update] Reuse Podfile setup
parent
3f214a9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
33 deletions
+26
-33
update_spec.rb
spec/functional/command/update_spec.rb
+26
-33
No files found.
spec/functional/command/update_spec.rb
View file @
c9092041
...
...
@@ -2,8 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Command
::
Update
do
extend
SpecHelper
::
TemporaryRepos
it
'tells the user that no Podfile was found in the project dir'
do
exception
=
lambda
{
run_command
(
'update'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the project directory."
...
...
@@ -23,19 +21,7 @@ module Pod
end
end
it
'tells the user that no Lockfile was found in the project dir'
do
file
=
temporary_directory
+
'Podfile'
File
.
open
(
file
,
'w'
)
do
|
f
|
f
.
puts
(
'platform :ios'
)
f
.
puts
(
'pod "Reachability"'
)
end
Dir
.
chdir
(
temporary_directory
)
do
exception
=
lambda
{
run_command
(
'update'
,
'Reachability'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile.lock' found in the project directory"
end
end
describe
'tells the user that the Pods cannot be updated unless they are installed'
do
describe
'with Podfile'
do
extend
SpecHelper
::
TemporaryRepos
before
do
...
...
@@ -44,32 +30,39 @@ module Pod
f
.
puts
(
'platform :ios'
)
f
.
puts
(
'pod "BananaLib", "1.0"'
)
end
end
podfile
=
Podfile
.
new
do
platform
:ios
pod
'BananaLib'
,
'1.0'
end
specs
=
[
Specification
.
new
do
|
s
|
s
.
name
=
'BananaLib'
s
.
version
=
'1.0'
end
,
]
external_sources
=
{}
Lockfile
.
generate
(
podfile
,
specs
,
external_sources
).
write_to_disk
(
temporary_directory
+
'Podfile.lock'
)
it
'tells the user that no Lockfile was found in the project dir'
do
exception
=
lambda
{
run_command
(
'update'
,
'BananaLib'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile.lock' found in the project directory"
end
it
'for a single missing Pod'
do
Dir
.
chdir
(
temporary_directory
)
do
describe
'tells the user that the Pods cannot be updated unless they are installed'
do
extend
SpecHelper
::
TemporaryRepos
before
do
podfile
=
Podfile
.
new
do
platform
:ios
pod
'BananaLib'
,
'1.0'
end
specs
=
[
Specification
.
new
do
|
s
|
s
.
name
=
'BananaLib'
s
.
version
=
'1.0'
end
,
]
external_sources
=
{}
Lockfile
.
generate
(
podfile
,
specs
,
external_sources
).
write_to_disk
(
temporary_directory
+
'Podfile.lock'
)
end
it
'for a single missing Pod'
do
should
.
raise
Informative
do
run_command
(
'update'
,
'Reachability'
,
'--no-repo-update'
)
end
.
message
.
should
.
include
'The `Reachability` Pod is not '
\
'installed and cannot be updated'
'installed and cannot be updated'
end
end
it
'for multiple missing Pods'
do
Dir
.
chdir
(
temporary_directory
)
do
it
'for multiple missing Pods'
do
exception
=
lambda
{
run_command
(
'update'
,
'Reachability'
,
'BananaLib2'
,
'--no-repo-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
'Pods `Reachability`, `BananaLib2` are not installed and cannot be updated'
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