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
d29a8ae7
Unverified
Commit
d29a8ae7
authored
May 16, 2016
by
Nate West
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Lib Specs] Separate specs by Lib commands
parent
e502741d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
61 deletions
+64
-61
create_spec.rb
spec/functional/command/lib/create_spec.rb
+1
-61
list_spec.rb
spec/functional/command/lib/list_spec.rb
+63
-0
No files found.
spec/functional/command/lib_spec.rb
→
spec/functional/command/lib
/create
_spec.rb
View file @
d29a8ae7
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
require
File
.
expand_path
(
'../../../
../
spec_helper'
,
__FILE__
)
module
Pod
module
Pod
describe
Command
::
Lib
::
Create
do
describe
Command
::
Lib
::
Create
do
...
@@ -57,64 +57,4 @@ module Pod
...
@@ -57,64 +57,4 @@ module Pod
run_command
(
'lib'
,
'create'
,
'TestPod'
)
run_command
(
'lib'
,
'create'
,
'TestPod'
)
end
end
end
end
describe
Command
::
Lib
::
Lint
do
it
'lints the current working directory'
do
Dir
.
chdir
(
fixture
(
'integration/Reachability'
))
do
cmd
=
command
(
'lib'
,
'lint'
,
'--only-errors'
,
'--quick'
)
cmd
.
run
UI
.
output
.
should
.
include
'passed validation'
end
end
it
'lints a single spec in the current working directory'
do
Dir
.
chdir
(
fixture
(
'integration/Reachability'
))
do
cmd
=
command
(
'lib'
,
'lint'
,
'Reachability.podspec'
,
'--quick'
,
'--only-errors'
)
cmd
.
run
UI
.
output
.
should
.
include
'passed validation'
end
end
it
'fails to lint a broken spec file and cleans up'
do
Dir
.
chdir
(
temporary_directory
)
do
open
(
temporary_directory
+
'Broken.podspec'
,
'w'
)
do
|
f
|
f
<<
'Pod::Spec.new do |spec|'
f
<<
"spec.name = 'Broken'"
f
<<
'end'
end
Validator
.
any_instance
.
expects
(
:no_clean
=
).
with
(
false
)
Validator
.
any_instance
.
stubs
(
:perform_extensive_analysis
)
should
.
raise
Pod
::
Informative
do
run_command
(
'lib'
,
'lint'
,
'Broken.podspec'
)
end
UI
.
output
.
should
.
include
'Missing required attribute'
end
end
it
'fails to lint a broken spec file and leaves lint directory'
do
Dir
.
chdir
(
temporary_directory
)
do
open
(
temporary_directory
+
'Broken.podspec'
,
'w'
)
do
|
f
|
f
<<
'Pod::Spec.new do |spec|'
f
<<
"spec.name = 'Broken'"
f
<<
'end'
end
Validator
.
any_instance
.
expects
(
:no_clean
=
).
with
(
true
)
Validator
.
any_instance
.
stubs
(
:perform_extensive_analysis
)
should
.
raise
Pod
::
Informative
do
run_command
(
'lib'
,
'lint'
,
'Broken.podspec'
,
'--no-clean'
)
end
UI
.
output
.
should
.
include
'Missing required attribute'
UI
.
output
.
should
.
include
'Pods workspace available at'
end
end
it
'fails to lint if the spec is not loaded'
do
Dir
.
chdir
(
temporary_directory
)
do
should
.
raise
Pod
::
Informative
do
run_command
(
'lib'
,
'lint'
,
'404.podspec'
)
end
UI
.
output
.
should
.
include
'could not be loaded'
end
end
end
end
end
spec/functional/command/lib/list_spec.rb
0 → 100644
View file @
d29a8ae7
require
File
.
expand_path
(
'../../../../spec_helper'
,
__FILE__
)
module
Pod
describe
Command
::
Lib
::
Lint
do
it
'lints the current working directory'
do
Dir
.
chdir
(
fixture
(
'integration/Reachability'
))
do
cmd
=
command
(
'lib'
,
'lint'
,
'--only-errors'
,
'--quick'
)
cmd
.
run
UI
.
output
.
should
.
include
'passed validation'
end
end
it
'lints a single spec in the current working directory'
do
Dir
.
chdir
(
fixture
(
'integration/Reachability'
))
do
cmd
=
command
(
'lib'
,
'lint'
,
'Reachability.podspec'
,
'--quick'
,
'--only-errors'
)
cmd
.
run
UI
.
output
.
should
.
include
'passed validation'
end
end
it
'fails to lint a broken spec file and cleans up'
do
Dir
.
chdir
(
temporary_directory
)
do
open
(
temporary_directory
+
'Broken.podspec'
,
'w'
)
do
|
f
|
f
<<
'Pod::Spec.new do |spec|'
f
<<
"spec.name = 'Broken'"
f
<<
'end'
end
Validator
.
any_instance
.
expects
(
:no_clean
=
).
with
(
false
)
Validator
.
any_instance
.
stubs
(
:perform_extensive_analysis
)
should
.
raise
Pod
::
Informative
do
run_command
(
'lib'
,
'lint'
,
'Broken.podspec'
)
end
UI
.
output
.
should
.
include
'Missing required attribute'
end
end
it
'fails to lint a broken spec file and leaves lint directory'
do
Dir
.
chdir
(
temporary_directory
)
do
open
(
temporary_directory
+
'Broken.podspec'
,
'w'
)
do
|
f
|
f
<<
'Pod::Spec.new do |spec|'
f
<<
"spec.name = 'Broken'"
f
<<
'end'
end
Validator
.
any_instance
.
expects
(
:no_clean
=
).
with
(
true
)
Validator
.
any_instance
.
stubs
(
:perform_extensive_analysis
)
should
.
raise
Pod
::
Informative
do
run_command
(
'lib'
,
'lint'
,
'Broken.podspec'
,
'--no-clean'
)
end
UI
.
output
.
should
.
include
'Missing required attribute'
UI
.
output
.
should
.
include
'Pods workspace available at'
end
end
it
'fails to lint if the spec is not loaded'
do
Dir
.
chdir
(
temporary_directory
)
do
should
.
raise
Pod
::
Informative
do
run_command
(
'lib'
,
'lint'
,
'404.podspec'
)
end
UI
.
output
.
should
.
include
'could not be loaded'
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