Skip to content

Commit 2ece25d

Browse files
committed
fix: client_provider specs are fixed
1 parent ad119dd commit 2ece25d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/cloud_controller/blobstore/storage_cli/storage_cli_client.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ class StorageCliClient < BaseClient
3030
def initialize(directory_key:, resource_type:, root_dir:, min_size: nil, max_size: nil)
3131
raise 'Missing resource_type' if resource_type.nil?
3232

33+
config_file_path = config_path_for(resource_type)
3334
cfg = fetch_config(resource_type)
3435
@provider = cfg['provider'].to_s
35-
raise BlobstoreError.new('No provider specified in config file') if @provider.empty?
36+
raise BlobstoreError.new("No provider specified in config file: #{File.basename(config_file_path)}") if @provider.empty?
3637
raise "Unimplemented provider: #{@provider}, implemented ones are: #{IMPLEMENTED_PROVIDERS.join(', ')}" unless IMPLEMENTED_PROVIDERS.include?(@provider)
3738

3839
@cli_path = cli_path
39-
@config_file = config_path_for(resource_type)
40+
@config_file = config_file_path
4041
@directory_key = directory_key
4142
@resource_type = resource_type.to_s
4243
@root_dir = root_dir

spec/unit/lib/cloud_controller/blobstore/client_provider_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ module Blobstore
146146
end
147147

148148
it 'provides a storage-cli client' do
149-
allow(StorageCliClient).to receive(:build).and_return(storage_cli_client_mock)
149+
allow(StorageCliClient).to receive(:new).and_return(storage_cli_client_mock)
150150
ClientProvider.provide(options:, directory_key:, root_dir:, resource_type:)
151-
expect(StorageCliClient).to have_received(:build).with(directory_key: directory_key, resource_type: resource_type, root_dir: root_dir,
152-
min_size: 100, max_size: 1000)
151+
expect(StorageCliClient).to have_received(:new).with(directory_key: directory_key, resource_type: resource_type, root_dir: root_dir,
152+
min_size: 100, max_size: 1000)
153153
end
154154

155155
it 'raises an error if provider is not provided' do

0 commit comments

Comments
 (0)