Ensure webmock is always loaded in the specs

parent 3353bb16
......@@ -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
......
......@@ -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
#-----------------------------------------------------------------------------#
......
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment