From 5ce299b05566686d3aa6f73b9cd39730ac065b5b Mon Sep 17 00:00:00 2001 From: Julian Fahrer Date: Mon, 27 Nov 2023 22:04:04 -0800 Subject: [PATCH] config file spec --- .../deployment_config/config_file_spec.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 spec/cove/deployment_config/config_file_spec.rb diff --git a/spec/cove/deployment_config/config_file_spec.rb b/spec/cove/deployment_config/config_file_spec.rb new file mode 100644 index 0000000..9d72d90 --- /dev/null +++ b/spec/cove/deployment_config/config_file_spec.rb @@ -0,0 +1,19 @@ +RSpec.describe Cove::DeploymentConfig::ConfigFile do + describe "#directory" do + context "when the path is at the relative root" do + it "returns nil" do + file = described_class.new(path: "postgresql.conf", content: "") + + expect(file.directory).to eq(nil) + end + end + + context "when the path is in a subdirectory directory" do + it "returns the path to the directory" do + file = described_class.new(path: "config/postgres/postgresql.conf", content: "") + + expect(file.directory).to eq("config/postgres") + end + end + end +end