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
60cb693f
Commit
60cb693f
authored
Dec 29, 2015
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update specs for removal of deprecations
parent
9242a26c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
30 deletions
+10
-30
hooks_manager.rb
lib/cocoapods/hooks_manager.rb
+1
-1
setup_spec.rb
spec/functional/command/setup_spec.rb
+0
-20
hooks_manager_spec.rb
spec/unit/hooks_manager_spec.rb
+9
-9
No files found.
lib/cocoapods/hooks_manager.rb
View file @
60cb693f
...
@@ -44,7 +44,7 @@ module Pod
...
@@ -44,7 +44,7 @@ module Pod
#
#
def
initialize
(
name
,
plugin_name
,
block
)
def
initialize
(
name
,
plugin_name
,
block
)
raise
ArgumentError
,
'Missing name'
unless
name
raise
ArgumentError
,
'Missing name'
unless
name
raise
ArgumentError
,
'Missing plugin_name'
unless
name
raise
ArgumentError
,
'Missing plugin_name'
unless
plugin_
name
raise
ArgumentError
,
'Missing block'
unless
block
raise
ArgumentError
,
'Missing block'
unless
block
@name
=
name
@name
=
name
...
...
spec/functional/command/setup_spec.rb
View file @
60cb693f
...
@@ -53,25 +53,5 @@ module Pod
...
@@ -53,25 +53,5 @@ module Pod
`git log --pretty=oneline`
.
strip
.
split
(
"
\n
"
).
size
.
should
>
1
`git log --pretty=oneline`
.
strip
.
split
(
"
\n
"
).
size
.
should
>
1
end
end
end
end
before
do
FileUtils
.
rm_rf
(
test_repo_path
)
set_up_old_test_repo
config
.
repos_dir
=
SpecHelper
.
temporary_directory
+
'cocoapods/repos'
Command
::
Setup
.
any_instance
.
stubs
(
:old_master_repo_dir
).
returns
(
SpecHelper
.
temporary_directory
+
'cocoapods/master'
)
end
it
'migrates repos from the old directory structure to the new one'
do
source
=
SpecHelper
.
temporary_directory
+
'cocoapods/master'
target
=
config
.
repos_dir
+
'master'
source
.
should
.
exist?
target
.
should
.
not
.
exist?
run_command
(
'setup'
)
source
.
should
.
not
.
exist?
target
.
should
.
exist?
end
end
end
end
end
spec/unit/hooks_manager_spec.rb
View file @
60cb693f
...
@@ -19,26 +19,26 @@ module Pod
...
@@ -19,26 +19,26 @@ module Pod
it
'raises if no name is given'
do
it
'raises if no name is given'
do
should
.
raise
ArgumentError
do
should
.
raise
ArgumentError
do
@hooks_manager
.
register
(
nil
)
{}
@hooks_manager
.
register
(
'name'
,
nil
)
{}
end
end
end
end
it
'raises if no block is given'
do
it
'raises if no block is given'
do
should
.
raise
ArgumentError
do
should
.
raise
ArgumentError
do
@hooks_manager
.
register
(
:post_install
)
@hooks_manager
.
register
(
'name'
,
:post_install
)
end
end
end
end
it
'
warn
s if no plugin name is given'
do
it
'
raise
s if no plugin name is given'
do
@hooks_manager
.
register
(
:post_install
)
{}
should
.
raise
ArgumentError
do
UI
.
warnings
.
should
.
match
/hooks without.*deprecated/
@hooks_manager
.
register
(
nil
,
:post_install
)
{}
UI
.
warnings
.
should
.
match
/
#{
__FILE__
}
/
end
end
end
end
end
describe
'run'
do
describe
'run'
do
it
'invokes the hooks'
do
it
'invokes the hooks'
do
@hooks_manager
.
register
(
:post_install
)
do
|
_options
|
@hooks_manager
.
register
(
'plugin'
,
:post_install
)
do
|
_options
|
true
.
should
.
be
.
true
true
.
should
.
be
.
true
end
end
@hooks_manager
.
run
(
:post_install
,
Object
.
new
)
@hooks_manager
.
run
(
:post_install
,
Object
.
new
)
...
@@ -51,7 +51,7 @@ module Pod
...
@@ -51,7 +51,7 @@ module Pod
end
end
it
'handles the case that no listeners have registered for a name'
do
it
'handles the case that no listeners have registered for a name'
do
@hooks_manager
.
register
(
:post_install
)
do
|
_options
|
@hooks_manager
.
register
(
'plugin'
,
:post_install
)
do
|
_options
|
true
.
should
.
be
.
true
true
.
should
.
be
.
true
end
end
should
.
not
.
raise
do
should
.
not
.
raise
do
...
@@ -106,7 +106,7 @@ module Pod
...
@@ -106,7 +106,7 @@ module Pod
it
'prints a message in verbose mode when any hooks are run'
do
it
'prints a message in verbose mode when any hooks are run'
do
config
.
verbose
=
true
config
.
verbose
=
true
@hooks_manager
.
register
(
:post_install
)
{}
@hooks_manager
.
register
(
'plugin'
,
:post_install
)
{}
@hooks_manager
.
run
(
:post_install
,
Object
.
new
)
@hooks_manager
.
run
(
:post_install
,
Object
.
new
)
UI
.
output
.
should
.
match
/- Running post install hooks/
UI
.
output
.
should
.
match
/- Running post install hooks/
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