Skip to content

Commit 21a4b15

Browse files
committed
test: support older rubies
1 parent 328c7b6 commit 21a4b15

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/rspec_api_documentation.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require 'logger' # Ensure Logger is loaded for ActiveSupport 6.1+ compatibility with Ruby <= 2.6
12
require 'active_support'
23
require 'active_support/inflector'
34
require 'active_support/core_ext/array/extract_options'

spec/http_test_client_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
describe RspecApiDocumentation::HttpTestClient do
99
before(:all) do
1010
WebMock.allow_net_connect!
11-
Capybara.server = :webrick
11+
# Capybara.server= was introduced in later versions
12+
# For older versions, we use the Capybara::Server directly with webrick
13+
if Capybara.respond_to?(:server=)
14+
Capybara.server = :webrick
15+
end
1216
server = Capybara::Server.new(StubApp.new, port: 8888)
1317
server.boot
1418
end

0 commit comments

Comments
 (0)