Skip to content

Commit

Permalink
config file spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jfahrer committed Nov 28, 2023
1 parent 6568ed8 commit 5ce299b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/cove/deployment_config/config_file_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5ce299b

Please sign in to comment.