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
ec33cde4
Commit
ec33cde4
authored
Oct 06, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that we raise when attempting to stub an undefined method
parent
87d622c3
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
12 deletions
+15
-12
sandbox_analyzer.rb
lib/cocoapods/installer/analyzer/sandbox_analyzer.rb
+2
-0
inter_process_communication_spec.rb
spec/functional/command/inter_process_communication_spec.rb
+2
-2
search_spec.rb
spec/functional/command/search_spec.rb
+1
-1
spec_helper.rb
spec/spec_helper.rb
+2
-0
user_project_integrator_spec.rb
spec/unit/installer/user_project_integrator_spec.rb
+1
-1
installer_spec.rb
spec/unit/installer_spec.rb
+0
-1
sources_manager_spec.rb
spec/unit/sources_manager_spec.rb
+6
-6
validator_spec.rb
spec/unit/validator_spec.rb
+1
-1
No files found.
lib/cocoapods/installer/analyzer/sandbox_analyzer.rb
View file @
ec33cde4
...
@@ -40,6 +40,8 @@ module Pod
...
@@ -40,6 +40,8 @@ module Pod
#
#
attr_reader
:update_mode
attr_reader
:update_mode
alias_method
:update_mode?
,
:update_mode
# @return [Lockfile] The lockfile of the installation as a fall-back if
# @return [Lockfile] The lockfile of the installation as a fall-back if
# there is no sandbox manifest. This is indented as a temporary
# there is no sandbox manifest. This is indented as a temporary
# solution to prevent the full re-installation from users which
# solution to prevent the full re-installation from users which
...
...
spec/functional/command/inter_process_communication_spec.rb
View file @
ec33cde4
...
@@ -42,9 +42,9 @@ module Pod
...
@@ -42,9 +42,9 @@ module Pod
it
'prints a list of podspecs in the yaml format and prints it to STDOUT'
do
it
'prints a list of podspecs in the yaml format and prints it to STDOUT'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
set
=
Specification
.
new
(
'BananaLib'
)
set
=
Specification
::
Set
.
new
(
'BananaLib'
,
[]
)
set
.
stubs
(
:specification
).
returns
(
spec
)
set
.
stubs
(
:specification
).
returns
(
spec
)
Source
sManager
.
stubs
(
:all
_sets
).
returns
([
set
])
Source
.
any_instance
.
stubs
(
:pod
_sets
).
returns
([
set
])
out
=
run_command
(
'ipc'
,
'list'
)
out
=
run_command
(
'ipc'
,
'list'
)
out
.
should
.
include
(
'---'
)
out
.
should
.
include
(
'---'
)
...
...
spec/functional/command/search_spec.rb
View file @
ec33cde4
...
@@ -7,7 +7,7 @@ module Pod
...
@@ -7,7 +7,7 @@ module Pod
before
do
before
do
@test_source
=
Source
.
new
(
fixture
(
'spec-repos/test_repo'
))
@test_source
=
Source
.
new
(
fixture
(
'spec-repos/test_repo'
))
Source
::
Aggregate
.
any_instance
.
stubs
(
:all
).
returns
([
@test_source
])
Source
sManager
.
stubs
(
:all
).
returns
([
@test_source
])
SourcesManager
.
updated_search_index
=
nil
SourcesManager
.
updated_search_index
=
nil
end
end
...
...
spec/spec_helper.rb
View file @
ec33cde4
...
@@ -92,6 +92,8 @@ module Bacon
...
@@ -92,6 +92,8 @@ module Bacon
end
end
end
end
Mocha
::
Configuration
.
prevent
(
:stubbing_non_existent_method
)
module
SpecHelper
module
SpecHelper
def
self
.
temporary_directory
def
self
.
temporary_directory
ROOT
+
'tmp'
ROOT
+
'tmp'
...
...
spec/unit/installer/user_project_integrator_spec.rb
View file @
ec33cde4
...
@@ -136,7 +136,7 @@ module Pod
...
@@ -136,7 +136,7 @@ module Pod
workspace
=
Xcodeproj
::
Workspace
.
new
(
file_references
)
workspace
=
Xcodeproj
::
Workspace
.
new
(
file_references
)
workspace_path
=
@integrator
.
send
(
:workspace_path
)
workspace_path
=
@integrator
.
send
(
:workspace_path
)
workspace
.
save_as
(
workspace_path
)
workspace
.
save_as
(
workspace_path
)
Xcodeproj
::
Workspace
.
expects
(
:save_as
).
never
Xcodeproj
::
Workspace
.
any_instance
.
expects
(
:save_as
).
never
@integrator
.
send
(
:create_workspace
)
@integrator
.
send
(
:create_workspace
)
end
end
...
...
spec/unit/installer_spec.rb
View file @
ec33cde4
...
@@ -74,7 +74,6 @@ module Pod
...
@@ -74,7 +74,6 @@ module Pod
@installer
.
stubs
(
:run_pre_install_hooks
)
@installer
.
stubs
(
:run_pre_install_hooks
)
@installer
.
stubs
(
:install_file_references
)
@installer
.
stubs
(
:install_file_references
)
@installer
.
stubs
(
:install_libraries
)
@installer
.
stubs
(
:install_libraries
)
@installer
.
stubs
(
:link_aggregate_target
)
@installer
.
stubs
(
:write_lockfiles
)
@installer
.
stubs
(
:write_lockfiles
)
@installer
.
stubs
(
:aggregate_targets
).
returns
([])
@installer
.
stubs
(
:aggregate_targets
).
returns
([])
@installer
.
unstub
(
:generate_pods_project
)
@installer
.
unstub
(
:generate_pods_project
)
...
...
spec/unit/sources_manager_spec.rb
View file @
ec33cde4
...
@@ -38,13 +38,13 @@ module Pod
...
@@ -38,13 +38,13 @@ module Pod
describe
'In general'
do
describe
'In general'
do
before
do
before
do
Source
::
Aggregate
.
any_instance
.
stubs
(
:all
).
returns
([
@test_source
])
Source
sManager
.
stubs
(
:all
).
returns
([
@test_source
])
end
end
#--------------------------------------#
#--------------------------------------#
it
'returns all the sources'
do
it
'returns all the sources'
do
Source
::
Aggregate
.
any_instance
.
unstub
(
:all
)
Source
sManager
.
unstub
(
:all
)
SourcesManager
.
all
.
map
(
&
:name
).
should
==
%w(master test_repo)
SourcesManager
.
all
.
map
(
&
:name
).
should
==
%w(master test_repo)
end
end
...
@@ -66,21 +66,21 @@ module Pod
...
@@ -66,21 +66,21 @@ module Pod
end
end
it
'can perform a full text search of the sets'
do
it
'can perform a full text search of the sets'
do
Source
::
Aggregate
.
any_instance
.
stubs
(
:all
).
returns
([
@test_source
])
Source
sManager
.
stubs
(
:all
).
returns
([
@test_source
])
sets
=
SourcesManager
.
search_by_name
(
'Chunky'
,
true
)
sets
=
SourcesManager
.
search_by_name
(
'Chunky'
,
true
)
sets
.
all?
{
|
s
|
s
.
class
==
Specification
::
Set
}.
should
.
be
.
true
sets
.
all?
{
|
s
|
s
.
class
==
Specification
::
Set
}.
should
.
be
.
true
sets
.
any?
{
|
s
|
s
.
name
==
'BananaLib'
}.
should
.
be
.
true
sets
.
any?
{
|
s
|
s
.
name
==
'BananaLib'
}.
should
.
be
.
true
end
end
it
'can perform a full text regexp search of the sets'
do
it
'can perform a full text regexp search of the sets'
do
Source
::
Aggregate
.
any_instance
.
stubs
(
:all
).
returns
([
@test_source
])
Source
sManager
.
stubs
(
:all
).
returns
([
@test_source
])
sets
=
SourcesManager
.
search_by_name
(
'Ch[aeiou]nky'
,
true
)
sets
=
SourcesManager
.
search_by_name
(
'Ch[aeiou]nky'
,
true
)
sets
.
all?
{
|
s
|
s
.
class
==
Specification
::
Set
}.
should
.
be
.
true
sets
.
all?
{
|
s
|
s
.
class
==
Specification
::
Set
}.
should
.
be
.
true
sets
.
any?
{
|
s
|
s
.
name
==
'BananaLib'
}.
should
.
be
.
true
sets
.
any?
{
|
s
|
s
.
name
==
'BananaLib'
}.
should
.
be
.
true
end
end
it
"generates the search index before performing a search if it doesn't exits"
do
it
"generates the search index before performing a search if it doesn't exits"
do
Source
::
Aggregate
.
any_instance
.
stubs
(
:all
).
returns
([
@test_source
])
Source
sManager
.
stubs
(
:all
).
returns
([
@test_source
])
Source
::
Aggregate
.
any_instance
.
expects
(
:generate_search_index
).
returns
(
'BananaLib'
=>
{})
Source
::
Aggregate
.
any_instance
.
expects
(
:generate_search_index
).
returns
(
'BananaLib'
=>
{})
Source
::
Aggregate
.
any_instance
.
expects
(
:update_search_index
).
never
Source
::
Aggregate
.
any_instance
.
expects
(
:update_search_index
).
never
SourcesManager
.
updated_search_index
=
nil
SourcesManager
.
updated_search_index
=
nil
...
@@ -89,7 +89,7 @@ module Pod
...
@@ -89,7 +89,7 @@ module Pod
it
'updates the search index before performing a search if it exits'
do
it
'updates the search index before performing a search if it exits'
do
File
.
open
(
SourcesManager
.
search_index_path
,
'w'
)
{
|
file
|
file
.
write
(
"---
\n
BananaLib:
\n
version: 0.0.1"
)
}
File
.
open
(
SourcesManager
.
search_index_path
,
'w'
)
{
|
file
|
file
.
write
(
"---
\n
BananaLib:
\n
version: 0.0.1"
)
}
Source
::
Aggregate
.
any_instance
.
stubs
(
:all
).
returns
([
@test_source
])
Source
sManager
.
stubs
(
:all
).
returns
([
@test_source
])
Source
::
Aggregate
.
any_instance
.
expects
(
:generate_search_index
).
never
Source
::
Aggregate
.
any_instance
.
expects
(
:generate_search_index
).
never
Source
::
Aggregate
.
any_instance
.
expects
(
:update_search_index
).
returns
(
'BananaLib'
=>
{})
Source
::
Aggregate
.
any_instance
.
expects
(
:update_search_index
).
returns
(
'BananaLib'
=>
{})
SourcesManager
.
updated_search_index
=
nil
SourcesManager
.
updated_search_index
=
nil
...
...
spec/unit/validator_spec.rb
View file @
ec33cde4
...
@@ -202,7 +202,7 @@ module Pod
...
@@ -202,7 +202,7 @@ module Pod
end
end
it
'checks if the social media URL is valid'
do
it
'checks if the social media URL is valid'
do
Specification
.
any_instance
.
stubs
(
:social_media_url
on_url
).
returns
(
'http://banana-corp.local/'
)
Specification
.
any_instance
.
stubs
(
:social_media_url
).
returns
(
'http://banana-corp.local/'
)
WebMock
::
API
.
stub_request
(
:head
,
/banana-corp.local/
).
to_return
(
:status
=>
200
)
WebMock
::
API
.
stub_request
(
:head
,
/banana-corp.local/
).
to_return
(
:status
=>
200
)
@sut
.
validate
@sut
.
validate
@sut
.
results
.
should
.
be
.
empty?
@sut
.
results
.
should
.
be
.
empty?
...
...
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