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
c7581887
Commit
c7581887
authored
Mar 26, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#188] Added tests
parent
8347b776
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
0 deletions
+85
-0
list_spec.rb
spec/functional/command/list_spec.rb
+47
-0
set_present_spec.rb
spec/unit/command/set_present_spec.rb
+38
-0
No files found.
spec/functional/command/list_spec.rb
0 → 100644
View file @
c7581887
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
"Pod::Command::List"
do
extend
SpecHelper
::
Git
before
do
config
.
repos_dir
=
fixture
(
'spec-repos'
)
end
after
do
config
.
repos_dir
=
tmp_repos_path
end
def
command
(
arguments
=
argv
)
command
=
Pod
::
Command
::
List
.
new
(
arguments
)
def
command
.
puts
(
msg
=
''
)
(
@printed
||=
''
)
<<
"
#{
msg
}
\n
"
end
command
end
it
"it accepts corret inputs and runs without errors"
do
lambda
{
command
().
run
}.
should
.
not
.
raise
lambda
{
command
(
argv
(
'10'
)).
run
}.
should
.
not
.
raise
end
it
"complains if the days parameter is not a number"
do
lambda
{
command
(
argv
(
'10a'
)).
run
}.
should
.
raise
Pod
::
Command
::
Help
end
it
"returns the specs know in a given commit"
do
specs
=
command
(
argv
(
'10'
)).
spec_names_from_commit
(
'cad98852103394951850f89f0efde08f9dc41830'
)
specs
[
00
].
should
==
'A2DynamicDelegate'
specs
[
10
].
should
==
'DCTTextFieldValidator'
specs
[
20
].
should
==
'INKeychainAccess'
specs
[
30
].
should
==
'MKNetworkKit'
end
it
"returns the new specs introduced after a given commit"
do
new_specs
=
command
(
argv
(
'10'
)).
new_specs_set
(
'1c138d254bd39a3ccbe95a720098e2aaad5c5fc1'
)
new_specs
[
0
].
name
.
should
==
'iCarousel'
new_specs
[
1
].
name
.
should
==
'libPusher'
end
end
spec/unit/command/set_present_spec.rb
0 → 100644
View file @
c7581887
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
Pod
::
Command
::
SetPresent
do
before
do
@set
=
Pod
::
Spec
::
Set
.
new
(
fixture
(
'spec-repos/master/CocoaLumberjack'
))
@dummy
=
Object
.
new
@dummy
.
extend
(
Pod
::
Command
::
SetPresent
)
def
@dummy
.
puts
(
msg
=
''
)
(
@printed
||=
''
)
<<
"
#{
msg
}
\n
"
end
def
@dummy
.
prinded
()
@printed
.
chomp
end
end
it
"repects the `--name-only' option"
do
@dummy
.
parse_set_options
(
argv
(
'--name-only'
))
@dummy
.
present_set
(
@set
)
@dummy
.
prinded
.
should
==
'CocoaLumberjack'
end
it
"presents the name, version, description, homepage and source of a specification set"
do
@dummy
.
parse_set_options
(
argv
())
@dummy
.
present_set
(
@set
)
@dummy
.
prinded
.
should
.
include?
'CocoaLumberjack'
@dummy
.
prinded
.
should
.
include?
'1.0'
@dummy
.
prinded
.
should
.
include?
'1.1'
@dummy
.
prinded
.
should
.
include?
'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.'
@dummy
.
prinded
.
should
.
include?
'https://github.com/robbiehanson/CocoaLumberjack'
@dummy
.
prinded
.
should
.
include?
'https://github.com/robbiehanson/CocoaLumberjack.git'
end
it
"presents the stats of a specification set"
do
@dummy
.
parse_set_options
(
argv
(
'--stats'
))
@dummy
.
present_set
(
@set
)
@dummy
.
prinded
.
should
.
match
(
/Watchers:\W+[0-9]+/
)
@dummy
.
prinded
.
should
.
match
(
/Forks:\W+[0-9]+/
)
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