Skip to content

Commit

Permalink
Helper rename
Browse files Browse the repository at this point in the history
  • Loading branch information
svanhesteren committed Feb 14, 2024
1 parent 7a7a39a commit 07db351
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions spec/eyaml/railtie_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions spec/support/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 07db351

Please sign in to comment.