From 07db35141f6a8506d0f10d1abdba2ad1f0834194 Mon Sep 17 00:00:00 2001 From: Sebastian van Hesteren Date: Wed, 14 Feb 2024 17:45:01 +0100 Subject: [PATCH] Helper rename --- spec/eyaml/railtie_spec.rb | 24 ++++++++++++------------ spec/support/rails_helper.rb | 8 ++++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/spec/eyaml/railtie_spec.rb b/spec/eyaml/railtie_spec.rb index 1f06603..c376934 100644 --- a/spec/eyaml/railtie_spec.rb +++ b/spec/eyaml/railtie_spec.rb @@ -57,19 +57,19 @@ describe "prioritizes 'credentials' with extension" do it "eyaml" do - remove_all_that_dont_end_with(".eyaml") + remove_auth_files_that_dont_end_with(".eyaml") run_load_hooks expect(credentials).to(include(_extension: "eyaml")) end it "eyml" do - remove_all_that_dont_end_with(".eyml") + remove_auth_files_that_dont_end_with(".eyml") run_load_hooks expect(credentials).to(include(_extension: "eyml")) end it "ejson" do - remove_all_that_dont_end_with(".ejson") + remove_auth_files_that_dont_end_with(".ejson") run_load_hooks expect(credentials).to(include(_extension: "ejson")) end @@ -82,20 +82,20 @@ before { allow_rails.to(receive(:env).and_return(:env)) } it "eyaml" do - remove_all_that_dont_end_with(".eyaml") + remove_auth_files_that_dont_end_with(".eyaml") run_load_hooks expect(credentials).to(include(_extension: "eyaml")) end it "eyml" do - remove_all_that_dont_end_with(".eyml") + remove_auth_files_that_dont_end_with(".eyml") run_load_hooks expect(credentials).to(include(_extension: "eyml")) end it "ejson" do - remove_all_that_dont_end_with(".ejson") + remove_auth_files_that_dont_end_with(".ejson") run_load_hooks expect(credentials).to(include(_extension: "ejson")) end @@ -168,19 +168,19 @@ describe "prioritizes 'secrets' with extension" do it "eyaml" do - remove_all_that_dont_end_with(".eyaml") + remove_auth_files_that_dont_end_with(".eyaml") run_load_hooks expect(secrets).to(include(_extension: "eyaml")) end it "eyml" do - remove_all_that_dont_end_with(".eyml") + remove_auth_files_that_dont_end_with(".eyml") run_load_hooks expect(secrets).to(include(_extension: "eyml")) end it "ejson" do - remove_all_that_dont_end_with(".ejson") + remove_auth_files_that_dont_end_with(".ejson") run_load_hooks expect(secrets).to(include(_extension: "ejson")) end @@ -193,20 +193,20 @@ before { allow_rails.to(receive(:env).and_return(:env)) } it "eyaml" do - remove_all_that_dont_end_with(".eyaml") + remove_auth_files_that_dont_end_with(".eyaml") run_load_hooks expect(secrets).to(include(_extension: "eyaml")) end it "eyml" do - remove_all_that_dont_end_with(".eyml") + remove_auth_files_that_dont_end_with(".eyml") run_load_hooks expect(secrets).to(include(_extension: "eyml")) end it "ejson" do - remove_all_that_dont_end_with(".ejson") + remove_auth_files_that_dont_end_with(".ejson") run_load_hooks expect(secrets).to(include(_extension: "ejson")) end diff --git a/spec/support/rails_helper.rb b/spec/support/rails_helper.rb index 2f3b3a9..1cd2e73 100644 --- a/spec/support/rails_helper.rb +++ b/spec/support/rails_helper.rb @@ -40,10 +40,10 @@ def remove_environment_files(type: :secrets) end end - def remove_all_that_dont_end_with(ext) - Dir[config_root.join("*")].each do |secret_path| - next if secret_path.end_with?(ext) - File.delete(secret_path) + def remove_auth_files_that_dont_end_with(ext) + Dir[config_root.join("*")].each do |auth_path| + next if auth_path.end_with?(ext) + File.delete(auth_path) end end end