Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions apps/dashboard/test/unit/rclone_util_test.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# frozen_string_literal: true

require 'test_helper'
require 'rclone_helper'
require 'rclone_util'

class RcloneUtilTest < ActiveSupport::TestCase
test "list_remotes handles rclone.conf and env" do
with_rclone_conf("/") do
assert_equal ["alias_remote", "local_remote", "missing_auth", "s3"], RcloneUtil.list_remotes
test 'list_remotes handles rclone.conf and env' do
with_rclone_conf('/') do
assert_equal ['alias_remote', 'local_remote', 'missing_auth', 's3'], RcloneUtil.list_remotes
end
end

test "list_remotes handles missing rclone conf" do
with_modified_env(RCLONE_CONFIG: "/dev/null") do
assert_equal [], RcloneUtil.list_remotes
test 'list_remotes handles missing rclone conf' do
with_modified_env(RCLONE_CONFIG: '/dev/null') do
assert_equal [], RcloneUtil.list_remotes
end
end

Expand All @@ -23,9 +25,9 @@ class RcloneUtilTest < ActiveSupport::TestCase
end
end

test "list_remotes handles rclone.conf, env and extra rclone config" do
with_extra_rclone_conf("/") do
assert_equal ["alias_remote", "extra_remote", "local_remote", "missing_auth", "s3"], RcloneUtil.list_remotes
test 'list_remotes handles rclone.conf, env and extra rclone config' do
with_extra_rclone_conf('/') do
assert_equal ['alias_remote', 'extra_remote', 'local_remote', 'missing_auth', 's3'], RcloneUtil.list_remotes
end
end
end