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
b8512e5c
Unverified
Commit
b8512e5c
authored
Nov 12, 2016
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure webmock is always loaded in the specs
parent
3353bb16
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
spec_spec.rb
spec/functional/command/spec_spec.rb
+3
-1
spec_helper.rb
spec/spec_helper.rb
+1
-0
webmock.rb
spec/spec_helper/webmock.rb
+15
-0
No files found.
spec/functional/command/spec_spec.rb
View file @
b8512e5c
...
...
@@ -215,7 +215,9 @@ module Pod
end
it
'fails with an informative error when downloading the podspec 404s'
do
lambda
{
run_command
(
'spec'
,
'lint'
,
'https://no.such.domain/404'
)
}.
should
.
raise
Informative
WebMock
.
stub_request
(
:get
,
'https://no.such.domain/404'
).
to_return
(
:status
=>
404
,
:body
=>
''
,
:headers
=>
{})
lambda
{
run_command
(
'spec'
,
'lint'
,
'https://no.such.domain/404'
)
}.
should
.
raise
Informative
,
/404/
end
before
do
...
...
spec/spec_helper.rb
View file @
b8512e5c
...
...
@@ -44,6 +44,7 @@ require 'spec_helper/temporary_repos' # Allows to create and modify temporary sp
require
'spec_helper/temporary_cache'
# Allows to create temporary cache directory.
require
'spec_helper/user_interface'
# Redirects UI to UI.output & UI.warnings.
require
'spec_helper/pre_flight'
# Cleans the temporary directory, the config & the UI.output before every test.
require
'spec_helper/webmock'
# Cleans up mocks after each spec
#-----------------------------------------------------------------------------#
...
...
spec/spec_helper/webmock.rb
0 → 100644
View file @
b8512e5c
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
require
'webmock'
module
Bacon
class
Context
module
AfterWebMock
def
after
(
&
block
)
super
WebMock
.
reset!
end
end
include
AfterWebMock
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