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
742e7dab
Commit
742e7dab
authored
Apr 03, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow resetting Config.instance within a spec
parent
2cb671fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
spec_helper.rb
spec/spec_helper.rb
+12
-5
pre_flight.rb
spec/spec_helper/pre_flight.rb
+1
-8
No files found.
spec/spec_helper.rb
View file @
742e7dab
...
...
@@ -55,14 +55,10 @@ require 'spec_helper/webmock' # Cleans up mocks after each spec
#
module
Pod
class
Specification
alias_method
:original_source
,
:source
def
source
fixture
=
SpecHelper
.
fixture
(
"integration/
#{
name
}
"
)
result
=
super
if
fixture
.
exist?
# puts "Using fixture [#{name}]"
result
[
:git
]
=
fixture
.
to_s
end
result
[
:git
]
=
fixture
.
to_s
if
fixture
.
exist?
result
end
end
...
...
@@ -99,6 +95,17 @@ module SpecHelper
def
self
.
temporary_directory
ROOT
+
'tmp'
end
def
self
.
reset_config_instance
::
Pod
::
Config
.
instance
=
nil
::
Pod
::
Config
.
instance
.
tap
do
|
c
|
c
.
verbose
=
false
c
.
silent
=
true
c
.
repos_dir
=
fixture
(
'spec-repos'
)
c
.
installation_root
=
SpecHelper
.
temporary_directory
c
.
cache_root
=
SpecHelper
.
temporary_directory
+
'Cache'
end
end
end
def
temporary_sandbox
...
...
spec/spec_helper/pre_flight.rb
View file @
742e7dab
...
...
@@ -5,14 +5,7 @@ module Bacon
old_run_requirement
=
instance_method
(
:run_requirement
)
define_method
(
:run_requirement
)
do
|
description
,
spec
|
::
Pod
::
Config
.
instance
=
nil
::
Pod
::
Config
.
instance
.
tap
do
|
c
|
c
.
verbose
=
false
c
.
silent
=
true
c
.
repos_dir
=
fixture
(
'spec-repos'
)
c
.
installation_root
=
SpecHelper
.
temporary_directory
c
.
cache_root
=
SpecHelper
.
temporary_directory
+
'Cache'
end
::
SpecHelper
.
reset_config_instance
::
Pod
::
UI
.
output
=
''
::
Pod
::
UI
.
warnings
=
''
...
...
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