Skip to content

Commit f739423

Browse files
committed
fix github-server?
1 parent fc3b09b commit f739423

File tree

1 file changed

+16
-12
lines changed
  • spec/acceptance/github-server

1 file changed

+16
-12
lines changed

spec/acceptance/github-server/web.rb

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@
88
require "webrick/https"
99
require "openssl"
1010

11-
webrick_options = {
12-
Host: "0.0.0.0",
13-
Port: 443,
14-
Logger: WEBrick::Log::new($stderr, WEBrick::Log::DEBUG),
15-
SSLEnable: true,
16-
SSLVerifyClient: OpenSSL::SSL::VERIFY_NONE,
17-
SSLCertificate: OpenSSL::X509::Certificate.new(File.read("/acceptance/github-server/ssl.crt")),
18-
SSLPrivateKey: OpenSSL::PKey::RSA.new(File.read("/acceptance/github-server/ssl.key")),
19-
SSLCertName: [["CN", "github.fake"]]
20-
}
21-
2211
class FakeGitHubApi < Sinatra::Base
12+
set :server, %w[webrick]
13+
set :server_settings, {
14+
Host: "0.0.0.0",
15+
Port: 443,
16+
Logger: WEBrick::Log::new($stderr, WEBrick::Log::DEBUG),
17+
SSLEnable: true,
18+
SSLVerifyClient: OpenSSL::SSL::VERIFY_NONE,
19+
SSLCertificate: OpenSSL::X509::Certificate.new(File.read("/acceptance/github-server/ssl.crt")),
20+
SSLPrivateKey: OpenSSL::PKey::RSA.new(File.read("/acceptance/github-server/ssl.key")),
21+
SSLCertName: [["CN", "github.fake"]]
22+
}
23+
24+
set :port => 443
25+
set :bind => "0.0.0.0"
26+
2327
BASE_DIR = "/tmp/github"
2428

2529
TEAM_MAP_FILE = File.join(BASE_DIR, "team_map.json")
@@ -405,4 +409,4 @@ def graphql_pending_query(query)
405409
end
406410
end
407411

408-
Rack::Handler::WEBrick.run FakeGitHubApi, **webrick_options
412+
FakeGitHubApi.run!

0 commit comments

Comments
 (0)