mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Added version guard for OpenSSL::Config
This commit is contained in:
parent
e4a26cd4f8
commit
2fd779fcd9
2 changed files with 31 additions and 12 deletions
|
@ -1,8 +1,10 @@
|
|||
require_relative '../../../spec_helper'
|
||||
require_relative '../shared/constants'
|
||||
require_relative '../shared/version'
|
||||
|
||||
require 'openssl'
|
||||
|
||||
openssl_version_is(""..."2.2") do
|
||||
describe "OpenSSL::Config#freeze" do
|
||||
it "needs to be reviewed for completeness"
|
||||
|
||||
|
@ -18,3 +20,4 @@ describe "OpenSSL::Config#freeze" do
|
|||
}.should raise_error(TypeError)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
16
spec/ruby/library/openssl/shared/version.rb
Normal file
16
spec/ruby/library/openssl/shared/version.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
require 'openssl'
|
||||
|
||||
class OpenSSLVersionGuard < VersionGuard
|
||||
FULL_OPENSSL_VERSION = SpecVersion.new OpenSSL::VERSION
|
||||
def match?
|
||||
if Range === @version
|
||||
@version.include? FULL_OPENSSL_VERSION
|
||||
else
|
||||
FULL_OPENSSL_VERSION >= @version
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def openssl_version_is(*args, &block)
|
||||
OpenSSLVersionGuard.new(*args).run_if(:openssl_version_is, &block)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue