From 04f2dd0f820f06301dbe01c0efb2810ea10e9cb9 Mon Sep 17 00:00:00 2001 From: osc-bot <78549874+osc-bot@users.noreply.github.com> Date: Fri, 31 May 2024 14:10:02 -0400 Subject: [PATCH] lint a random file (#3578) --- apps/dashboard/test/rclone_helper.rb | 47 +++++++++++++++------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/apps/dashboard/test/rclone_helper.rb b/apps/dashboard/test/rclone_helper.rb index 9cb8835e52..8a5acdb473 100644 --- a/apps/dashboard/test/rclone_helper.rb +++ b/apps/dashboard/test/rclone_helper.rb @@ -1,27 +1,30 @@ -# helper functions for tests that use rclone/remote files in files app +# frozen_string_literal: true -class ActiveSupport::TestCase +# helper functions for tests that use rclone/remote files in files app - # Avoid using local remote directly to detect cases where the path is valid on both the remote - # and posix file system - def remote_files_conf(root_dir) - { - OOD_REMOTE_FILES_ENABLED: 'true', - RCLONE_CONFIG_LOCAL_REMOTE_TYPE: 'local', - RCLONE_CONFIG_ALIAS_REMOTE_TYPE: 'alias', - RCLONE_CONFIG_ALIAS_REMOTE_REMOTE: "local_remote:#{root_dir}", - RCLONE_CONFIG: Rails.root.join('test/fixtures/config/rclone/rclone.conf').to_s - } - end +module ActiveSupport + class TestCase + # Avoid using local remote directly to detect cases where the path is valid on both the remote + # and posix file system + def remote_files_conf(root_dir) + { + OOD_REMOTE_FILES_ENABLED: 'true', + RCLONE_CONFIG_LOCAL_REMOTE_TYPE: 'local', + RCLONE_CONFIG_ALIAS_REMOTE_TYPE: 'alias', + RCLONE_CONFIG_ALIAS_REMOTE_REMOTE: "local_remote:#{root_dir}", + RCLONE_CONFIG: Rails.root.join('test/fixtures/config/rclone/rclone.conf').to_s + } + end - def with_rclone_conf(root_dir, &block) - conf = remote_files_conf(root_dir) - with_modified_env(conf, &block) - end + def with_rclone_conf(root_dir, &block) + conf = remote_files_conf(root_dir) + with_modified_env(conf, &block) + end - def with_extra_rclone_conf(root_dir, &block) - conf = remote_files_conf(root_dir) - .merge({OOD_RCLONE_EXTRA_CONFIG: Rails.root.join('test/fixtures/config/rclone/extra_config.conf').to_s}) - with_modified_env(conf, &block) + def with_extra_rclone_conf(root_dir, &block) + conf = remote_files_conf(root_dir) + .merge({ OOD_RCLONE_EXTRA_CONFIG: Rails.root.join('test/fixtures/config/rclone/extra_config.conf').to_s }) + with_modified_env(conf, &block) + end end -end \ No newline at end of file +end