Ensure secret envs are present

This commit is contained in:
David Heinemeier Hansson
2023-01-21 10:58:11 +01:00
parent f6ca864e06
commit dda20eec11
3 changed files with 13 additions and 1 deletions

View File

@@ -113,6 +113,16 @@ class ConfigurationTest < ActiveSupport::TestCase
ENV["PASSWORD"] = nil
end
test "env args with missing secret" do
config = Mrsk::Configuration.new(@deploy.tap { |c| c.merge!({
env: { "secret" => [ "PASSWORD" ] }
}) })
assert_raises(KeyError) do
assert_equal [ "-e", "PASSWORD=secret123" ], config.env_args
end
end
test "ssh options" do
assert_equal "root", @config.ssh_options[:user]