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
66946a7f
Commit
66946a7f
authored
Jun 09, 2013
by
Ian Ynda-Hummel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a more thorough spec for init command.
parent
88af9c25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
15 deletions
+39
-15
init_spec.rb
spec/functional/command/init_spec.rb
+39
-15
No files found.
spec/functional/command/init_spec.rb
View file @
66946a7f
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
require
'xcodeproj'
module
Pod
module
Pod
describe
Command
::
Init
do
describe
Command
::
Init
do
it
"runs with no parameters"
do
it
"complains if project does not exist"
do
lambda
{
run_command
(
'init'
)
}.
should
.
not
.
raise
CLAide
::
Help
lambda
{
run_command
(
'init'
)
}.
should
.
raise
CLAide
::
Help
lambda
{
run_command
(
'init'
,
'foo.xcodeproj'
)
}.
should
.
raise
CLAide
::
Help
end
it
"complains if wrong parameters"
do
lambda
{
run_command
(
'too'
,
'many'
)
}.
should
.
raise
CLAide
::
Help
end
end
it
"complains
when given parameters
"
do
it
"complains
if more than one project exists and none is specified
"
do
lambda
{
run_command
(
'init'
,
'create'
)
}.
should
.
raise
CLAide
::
Help
pwd
=
Dir
.
pwd
lambda
{
run_command
(
'init'
,
'--create'
)
}.
should
.
raise
CLAide
::
Help
Dir
.
chdir
(
temporary_directory
)
lambda
{
run_command
(
'init'
,
'NAME'
)
}.
should
.
raise
CLAide
::
Help
lambda
{
run_command
(
'init'
,
'createa'
)
}.
should
.
raise
CLAide
::
Help
Xcodeproj
::
Project
.
new
.
save_as
(
temporary_directory
+
'test1.xcodeproj'
)
lambda
{
run_command
(
'init'
,
'agument1'
,
'2'
)
}.
should
.
raise
CLAide
::
Help
Xcodeproj
::
Project
.
new
.
save_as
(
temporary_directory
+
'test2.xcodeproj'
)
lambda
{
run_command
(
'init'
,
'which'
)
}.
should
.
raise
CLAide
::
Help
lambda
{
run_command
(
'init'
)
}.
should
.
raise
CLAide
::
Help
lambda
{
run_command
(
'init'
,
'cat'
)
}.
should
.
raise
CLAide
::
Help
lambda
{
run_command
(
'init'
,
'edit'
)
}.
should
.
raise
CLAide
::
Help
Dir
.
chdir
(
pwd
)
end
end
extend
SpecHelper
::
TemporaryRepos
it
"creates a Podfile for a project in current directory"
do
pwd
=
Dir
.
pwd
Dir
.
chdir
(
temporary_directory
)
it
"creates a Podfile"
do
Xcodeproj
::
Project
.
new
.
save_as
(
temporary_directory
+
'test1.xcodeproj'
)
run_command
(
'init'
)
run_command
(
'init'
)
path
=
temporary_directory
+
'Podfile'
Pathname
.
new
(
temporary_directory
+
'Podfile'
).
exist?
.
should
==
true
File
.
exists?
(
path
).
should
==
true
Dir
.
chdir
(
pwd
)
end
it
"creates a Podfile for a specified project"
do
pwd
=
Dir
.
pwd
Dir
.
chdir
(
temporary_directory
)
Xcodeproj
::
Project
.
new
.
save_as
(
temporary_directory
+
'test1.xcodeproj'
)
Xcodeproj
::
Project
.
new
.
save_as
(
temporary_directory
+
'test2.xcodeproj'
)
run_command
(
'init'
,
'test2.xcodeproj'
)
Pathname
.
new
(
temporary_directory
+
'Podfile'
).
exist?
.
should
==
true
Dir
.
chdir
(
pwd
)
end
end
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