require File.expand_path(File.dirname(__FILE__) + "/../spec_helper") describe Cardflex::Http do describe '_verify_ssl_certificate' do it 'should fail verification if preverify is false' do context = OpenSSL::X509::StoreContext.new(OpenSSL::X509::Store.new) sut = Cardflex::Configuration.instantiate.http._verify_ssl_certificate(false, context) expect(sut).to eq false end it 'should fail verification if context has an error' do context = OpenSSL::X509::StoreContext.new(OpenSSL::X509::Store.new) context.error = 0 sut = Cardflex::Configuration.instantiate.http._verify_ssl_certificate(false, context) expect(sut).to eq false end end end