From db9fa5bb1c450269d6d9f4a83c5b972c0af12f2f Mon Sep 17 00:00:00 2001 From: Aidan Haran Date: Sat, 19 Oct 2024 18:41:34 +0100 Subject: [PATCH] Added tests --- test/secrets_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/secrets_test.rb b/test/secrets_test.rb index bb77a1965..9cb9d64ab 100644 --- a/test/secrets_test.rb +++ b/test/secrets_test.rb @@ -31,4 +31,16 @@ class SecretsTest < ActiveSupport::TestCase assert_equal "JKL", Kamal::Secrets.new(destination: "nodest")["SECRET2"] end end + + test "no secrets files" do + with_test_secrets do + assert_raises(Kamal::ConfigurationError, "Secret 'SECRET' not found, cannot find secret files .kamal/secrets-common, .kamal/secrets") do + Kamal::Secrets.new["SECRET"] + end + + assert_raises(Kamal::ConfigurationError, "Secret 'SECRET' not found, cannot find secret files .kamal/secrets-common, .kamal/secrets.dest") do + Kamal::Secrets.new(destination: "dest")["SECRET"] + end + end + end end