Skip to content

Commit b95ac54

Browse files
author
Daniel Schmidt
committed
Bugfix: LBNL folder should not prefix path with / (DEV-46)
1 parent 6bc3c3b commit b95ac54

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/berkeley_library/sftp_handler/downloader/lbnl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Downloader
1313
class Lbnl < Base
1414
def download!(filename: nil, local_dir: '/opt/app/data')
1515
filename ||= default_filename
16-
remote_path = Pathname.new('/') + filename
16+
remote_path = Pathname.new(filename)
1717
local_path = Pathname.new(local_dir) + filename
1818
assert_not_exists! local_path
1919

spec/downloader/lbnl_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
let(:now) { Time.new(2022, 5, 25, 0, 0, 0) }
1111
let(:last_weeks_filename) { 'lbnl_people_20220516.zip' }
1212
let(:this_weeks_filename) { 'lbnl_people_20220523.zip' }
13-
let(:todays_remote_path) { Pathname.new("/#{this_weeks_filename}") }
13+
let(:todays_remote_path) { Pathname.new(this_weeks_filename) }
1414
let(:sftp_session) { instance_double(Net::SFTP::Session) }
1515

1616
before do
@@ -44,7 +44,7 @@
4444

4545
it "downloads a specific file" do
4646
filename = 'lbnl_people_20220516.zip'
47-
remote_path = Pathname.new("/#{filename}")
47+
remote_path = Pathname.new(filename)
4848
local_path = Pathname.new("/opt/app/data/#{filename}")
4949

5050
expect(sftp_session)

0 commit comments

Comments
 (0)