Skip to content

Commit aa15612

Browse files
committed
Update WebMock to latest 2.x version
Updating to WebMock 2.x means that: > require 'webmock' does not enable WebMock anymore. gem 'webmock' can now be safely added to a Gemfile and no http client libs will be modified when it's loaded. Call WebMock.enable! to enable WebMock. > > Please note that require 'webmock/rspec', require 'webmock/test_unit', require 'webmock/minitest' and require 'webmock/cucumber' still do enable WebMock. Source: [WebMock's CHANGELOG.md](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md#200). As rspec_api_documentation is very much tied to RSpec, I saw no problem with replacing all instances of `require 'webmock'` with `require 'webmock/rspec'`.
1 parent 4ddc4db commit aa15612

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

lib/rspec_api_documentation/dsl/resource.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def self.define_action(method)
3030

3131
def callback(*args, &block)
3232
begin
33-
require 'webmock'
33+
require 'webmock/rspec'
3434
rescue LoadError
3535
raise "Callbacks require webmock to be installed"
3636
end

lib/rspec_api_documentation/oauth2_mac_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# ActiveSupport::SecureRandom not provided in activesupport >= 3.2
55
end
66
begin
7-
require "webmock"
7+
require "webmock/rspec"
88
rescue LoadError
99
raise "Webmock needs to be installed before using the OAuth2MACClient"
1010
end

rspec_api_documentation.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
2626
s.add_development_dependency "rake", "~> 10.5.0"
2727
s.add_development_dependency "rack-test", "~> 0.6.3"
2828
s.add_development_dependency "rack-oauth2", "~> 1.2.2"
29-
s.add_development_dependency "webmock"
29+
s.add_development_dependency "webmock", "2.0.0"
3030
s.add_development_dependency "rspec-its", "~> 1.2.0"
3131
s.add_development_dependency "faraday", "~> 0.9.2"
3232
s.add_development_dependency "nokogiri", "~> 1.8.4"

spec/http_test_client_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'capybara'
44
require 'capybara/server'
55
require 'sinatra/base'
6-
require 'webmock'
6+
require 'webmock/rspec'
77
require 'support/stub_app'
88

99
describe RspecApiDocumentation::HttpTestClient do

0 commit comments

Comments
 (0)