Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support standalone adapters #941

Merged
merged 4 commits into from
Mar 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion faraday.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ Gem::Specification.new do |spec|

spec.add_dependency 'multipart-post', '>= 1.2', '< 3'

spec.files = `git ls-files -z lib LICENSE.md README.md`.split("\0")
spec.require_paths = %w[lib spec/external_adapters]
spec.files = `git ls-files -z lib spec/external_adapters`.split("\0")
spec.files += %w[LICENSE.md README.md]
end
14 changes: 14 additions & 0 deletions spec/external_adapters/faraday_specs_setup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

require 'webmock/rspec'
WebMock.disable_net_connect!(allow_localhost: true)

require_relative '../support/helper_methods'
require_relative '../support/disabling_stub'
require_relative '../support/streaming_response_checker'
require_relative '../support/shared_examples/adapter'
require_relative '../support/shared_examples/request_method'

RSpec.configure do |config|
config.include Faraday::HelperMethods
end
13 changes: 0 additions & 13 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,3 @@ def dump_pending(_arg); end

RSpec::Core::Formatters::DocumentationFormatter.prepend self
end

# Allows to disable WebMock stubs
module DisablingStub
def disable
@disabled = true
end

def disabled?
@disabled
end

WebMock::RequestStub.prepend self
end
14 changes: 14 additions & 0 deletions spec/support/disabling_stub.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

# Allows to disable WebMock stubs
module DisablingStub
def disable
@disabled = true
end

def disabled?
@disabled
end

WebMock::RequestStub.prepend self
end