Skip to content

Commit 8dac088

Browse files
committed
Adapt Credhub::Client spec
Method cert_store_items is only available for JRuby now, thus checking the configured credhub_ca.crt using a spy on OpenSSL::X509::Store instead.
1 parent 7cf0c1e commit 8dac088

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spec/unit/lib/credhub/client_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ module Credhub
1414
describe '#client' do
1515
describe 'ssl_config' do
1616
it 'uses the configured credhub_ca.crt' do
17-
expect(subject.send(:client).ssl_config.cert_store_items).
18-
to include(TestConfig.config_instance.get(:credhub_api, :ca_cert_path))
17+
expect_any_instance_of(OpenSSL::X509::Store).to receive(:add_file).with(TestConfig.config_instance.get(:credhub_api, :ca_cert_path)).exactly(:once)
18+
19+
subject.send(:build_client)
1920
end
2021
end
2122
end

0 commit comments

Comments
 (0)