【发布时间】:2012-06-07 16:55:38
【问题描述】:
我有一个方法:
require 'openssl'
def extract_creds(data)
pfx = OpenSSL::PKCS12.new(data)
{ :certificate => pfx.certificate.to_pem, :key => pfx.key.to_pem }
rescue
# handle error
end
我想为它写一个 rspec 示例。我应该如何正确模拟 pfx 对象?
【问题讨论】:
标签: ruby rspec mocking tdd openssl