diff options
Diffstat (limited to 'spec/ruby/library/openssl/shared/version.rb')
-rw-r--r-- | spec/ruby/library/openssl/shared/version.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/ruby/library/openssl/shared/version.rb b/spec/ruby/library/openssl/shared/version.rb new file mode 100644 index 0000000000..63837d3375 --- /dev/null +++ b/spec/ruby/library/openssl/shared/version.rb @@ -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 |