Skip to content

Commit

Permalink
Allow tests to run on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg authored and stanhu committed Apr 29, 2023
1 parent 80d9c02 commit e381976
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/puma/minissl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def check
def key_password
raise "Key password command not configured" if @key_password_command.nil?

stdout_str, stderr_str, status = Open3.capture3(key_password_command)
stdout_str, stderr_str, status = Open3.capture3(@key_password_command)

return stdout_str.chomp if status.success?

Expand Down
10 changes: 6 additions & 4 deletions test/test_integration_ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,13 @@ def test_ssl_run_with_localhost_authority
end

def test_ssl_run_with_encrypted_key
skip_if :jruby, :windows
skip_if :jruby

config = <<RUBY
key_path = '#{File.expand_path '../examples/puma/encrypted_puma_keypair.pem', __dir__}'
cert_path = '#{File.expand_path '../examples/puma/cert_puma.pem', __dir__}'
key_command = '#{File.expand_path '../examples/puma/key_password_command.sh', __dir__}'
key_command = ::Puma::IS_WINDOWS ? 'echo hello world' :
'#{File.expand_path '../examples/puma/key_password_command.sh', __dir__}'
ssl_bind '#{HOST}', '#{bind_port}', {
cert: cert_path,
Expand All @@ -222,12 +223,13 @@ def test_ssl_run_with_encrypted_key
end

def test_ssl_run_with_encrypted_pem
skip_if :jruby, :windows
skip_if :jruby

config = <<RUBY
key_path = '#{File.expand_path '../examples/puma/encrypted_puma_keypair.pem', __dir__}'
cert_path = '#{File.expand_path '../examples/puma/cert_puma.pem', __dir__}'
key_command = '#{File.expand_path '../examples/puma/key_password_command.sh', __dir__}'
key_command = ::Puma::IS_WINDOWS ? 'echo hello world' :
'#{File.expand_path '../examples/puma/key_password_command.sh', __dir__}'
ssl_bind '#{HOST}', '#{bind_port}', {
cert_pem: File.read(cert_path),
Expand Down

0 comments on commit e381976

Please sign in to comment.