summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorThayne McCombs <thayne@lucidchart.com>2022-08-05 10:27:17 -0600
committerThayne McCombs <thayne@lucidchart.com>2022-08-05 10:27:17 -0600
commitab1b49d7b0529bcd9be1a434915007e74a6c447d (patch)
tree9a3607e76bc6a99fefa100d0c822d512c7d2eecd /spec
parent042a25badeca5e4a87f157b6bdbd6a32499d1c7b (diff)
downloadchef-ab1b49d7b0529bcd9be1a434915007e74a6c447d.tar.gz
Add newline to end of sysctl files
If the sysctl file doesn't end with a newline, then Ubuntu's CIS audit won't correctly detect the sysctl configuration. Also, it is UNIX best practice to include a newline at the end of the last line of text files. Obvious fix. Signed-off-by: Thayne McCombs <thayne@lucid.co>
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/resource/sysctl_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/unit/resource/sysctl_spec.rb b/spec/unit/resource/sysctl_spec.rb
index 47556f5ee8..42b0c77d83 100644
--- a/spec/unit/resource/sysctl_spec.rb
+++ b/spec/unit/resource/sysctl_spec.rb
@@ -62,14 +62,14 @@ describe Chef::Resource::Sysctl do
context "when comment is a String" do
it "Returns content for use with a file resource" do
resource.comment("This sets foo / bar on our system")
- expect(provider.contruct_sysctl_content).to eql("# This sets foo / bar on our system\nfoo = bar")
+ expect(provider.contruct_sysctl_content).to eql("# This sets foo / bar on our system\nfoo = bar\n")
end
end
context "when comment is an Array" do
it "Returns content for use with a file resource" do
resource.comment(["This sets foo / bar on our system", "We need for baz"])
- expect(provider.contruct_sysctl_content).to eql("# This sets foo / bar on our system\n# We need for baz\nfoo = bar")
+ expect(provider.contruct_sysctl_content).to eql("# This sets foo / bar on our system\n# We need for baz\nfoo = bar\n")
end
end
end