Skip to content

Commit

Permalink
remove unnecessary | in heredoc
Browse files Browse the repository at this point in the history
  • Loading branch information
zilchms committed Feb 13, 2024
1 parent 8fbf6ef commit 7ded42e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
30 changes: 15 additions & 15 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@
let(:params) { { httpd: true } }

content = <<~END
|set httpd port 2812 and
| use address localhost
| allow 0.0.0.0/0.0.0.0
| allow admin:monit
set httpd port 2812 and
use address localhost
allow 0.0.0.0/0.0.0.0
allow admin:monit
END
it { is_expected.to contain_file('monit_config').with_content(%r{#{content}}) }
end
Expand All @@ -125,10 +125,10 @@
end

content = <<~END
|set httpd port 2420 and
| use address otherhost
| allow 0.0.0.0/0.0.0.0
| allow tester:Passw0rd
set httpd port 2420 and
use address otherhost
allow 0.0.0.0/0.0.0.0
allow tester:Passw0rd
END
it { is_expected.to contain_file('monit_config').with_content(%r{#{content}}) }
end
Expand Down Expand Up @@ -232,11 +232,11 @@
end

content = <<~END
|set mail-format {
| from: [email protected]
| message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION
| subject: spectesting
|}
set mail-format {
from: [email protected]
message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION
subject: spectesting
}
END
it { is_expected.to contain_file('monit_config').with_content(%r{#{content}}) }

Check failure on line 241 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

monit supported operating systems on centos-7-x86_64 parameter functionality when mailformat is set to valid hash is expected to contain File[monit_config] with content =~ /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / Failure/Error: it { is_expected.to contain_file('monit_config').with_content(%r{#{content}}) } expected that the catalogue would contain File[monit_config] with content set to /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / but it is set to "# monitrc: Managed by puppet.\n#\nset daemon 120\nset logfile /var/log/monit.log\nset idfile /var/lib/monit/id\nset statefile /var/lib/monit/state\nset mail-format {\n from: [email protected]\n message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION\n subject: spectesting\n}\nset eventqueue\n basedir /var/lib/monit/events\n slots 100\n\ninclude /etc/monit.d/*\n" Diff: @@ -1,7 +1,17 @@ -(?-mix:set mail-format { +# monitrc: Managed by puppet. +# +set daemon 120 +set logfile /var/log/monit.log +set idfile /var/lib/monit/id +set statefile /var/lib/monit/state +set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } -) +set eventqueue + basedir /var/lib/monit/events + slots 100 + +include /etc/monit.d/*

Check failure on line 241 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

monit supported operating systems on debian-11-x86_64 parameter functionality when mailformat is set to valid hash is expected to contain File[monit_config] with content =~ /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / Failure/Error: it { is_expected.to contain_file('monit_config').with_content(%r{#{content}}) } expected that the catalogue would contain File[monit_config] with content set to /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / but it is set to "# monitrc: Managed by puppet.\n#\nset daemon 120\nset logfile /var/log/monit.log\nset idfile /var/lib/monit/id\nset statefile /var/lib/monit/state\nset mail-format {\n from: [email protected]\n message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION\n subject: spectesting\n}\nset eventqueue\n basedir /var/lib/monit/events\n slots 100\n\ninclude /etc/monit/conf.d/*\n" Diff: @@ -1,7 +1,17 @@ -(?-mix:set mail-format { +# monitrc: Managed by puppet. +# +set daemon 120 +set logfile /var/log/monit.log +set idfile /var/lib/monit/id +set statefile /var/lib/monit/state +set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } -) +set eventqueue + basedir /var/lib/monit/events + slots 100 + +include /etc/monit/conf.d/*

Check failure on line 241 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

monit supported operating systems on centos-8-x86_64 parameter functionality when mailformat is set to valid hash is expected to contain File[monit_config] with content =~ /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / Failure/Error: it { is_expected.to contain_file('monit_config').with_content(%r{#{content}}) } expected that the catalogue would contain File[monit_config] with content set to /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / but it is set to "# monitrc: Managed by puppet.\n#\nset daemon 120\nset logfile /var/log/monit.log\nset idfile /var/lib/monit/id\nset statefile /var/lib/monit/state\nset mail-format {\n from: [email protected]\n message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION\n subject: spectesting\n}\nset eventqueue\n basedir /var/lib/monit/events\n slots 100\n\ninclude /etc/monit.d/*\n" Diff: @@ -1,7 +1,17 @@ -(?-mix:set mail-format { +# monitrc: Managed by puppet. +# +set daemon 120 +set logfile /var/log/monit.log +set idfile /var/lib/monit/id +set statefile /var/lib/monit/state +set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } -) +set eventqueue + basedir /var/lib/monit/events + slots 100 + +include /etc/monit.d/*

Check failure on line 241 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

monit supported operating systems on redhat-7-x86_64 parameter functionality when mailformat is set to valid hash is expected to contain File[monit_config] with content =~ /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / Failure/Error: it { is_expected.to contain_file('monit_config').with_content(%r{#{content}}) } expected that the catalogue would contain File[monit_config] with content set to /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / but it is set to "# monitrc: Managed by puppet.\n#\nset daemon 120\nset logfile /var/log/monit.log\nset idfile /var/lib/monit/id\nset statefile /var/lib/monit/state\nset mail-format {\n from: [email protected]\n message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION\n subject: spectesting\n}\nset eventqueue\n basedir /var/lib/monit/events\n slots 100\n\ninclude /etc/monit.d/*\n" Diff: @@ -1,7 +1,17 @@ -(?-mix:set mail-format { +# monitrc: Managed by puppet. +# +set daemon 120 +set logfile /var/log/monit.log +set idfile /var/lib/monit/id +set statefile /var/lib/monit/state +set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } -) +set eventqueue + basedir /var/lib/monit/events + slots 100 + +include /etc/monit.d/*

Check failure on line 241 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

monit supported operating systems on oraclelinux-8-x86_64 parameter functionality when mailformat is set to valid hash is expected to contain File[monit_config] with content =~ /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / Failure/Error: it { is_expected.to contain_file('monit_config').with_content(%r{#{content}}) } expected that the catalogue would contain File[monit_config] with content set to /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / but it is set to "# monitrc: Managed by puppet.\n#\nset daemon 120\nset logfile /var/log/monit.log\nset idfile /var/lib/monit/id\nset statefile /var/lib/monit/state\nset mail-format {\n from: [email protected]\n message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION\n subject: spectesting\n}\nset eventqueue\n basedir /var/lib/monit/events\n slots 100\n\ninclude /etc/monit.d/*\n" Diff: @@ -1,7 +1,17 @@ -(?-mix:set mail-format { +# monitrc: Managed by puppet. +# +set daemon 120 +set logfile /var/log/monit.log +set idfile /var/lib/monit/id +set statefile /var/lib/monit/state +set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } -) +set eventqueue + basedir /var/lib/monit/events + slots 100 + +include /etc/monit.d/*

Check failure on line 241 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

monit supported operating systems on oraclelinux-9-x86_64 parameter functionality when mailformat is set to valid hash is expected to contain File[monit_config] with content =~ /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / Failure/Error: it { is_expected.to contain_file('monit_config').with_content(%r{#{content}}) } expected that the catalogue would contain File[monit_config] with content set to /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / but it is set to "# monitrc: Managed by puppet.\n#\nset daemon 120\nset logfile /var/log/monit.log\nset idfile /var/lib/monit/id\nset statefile /var/lib/monit/state\nset mail-format {\n from: [email protected]\n message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION\n subject: spectesting\n}\nset eventqueue\n basedir /var/lib/monit/events\n slots 100\n\ninclude /etc/monit.d/*\n" Diff: @@ -1,7 +1,17 @@ -(?-mix:set mail-format { +# monitrc: Managed by puppet. +# +set daemon 120 +set logfile /var/log/monit.log +set idfile /var/lib/monit/id +set statefile /var/lib/monit/state +set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } -) +set eventqueue + basedir /var/lib/monit/events + slots 100 + +include /etc/monit.d/*

Check failure on line 241 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

monit supported operating systems on ubuntu-18.04-x86_64 parameter functionality when mailformat is set to valid hash is expected to contain File[monit_config] with content =~ /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / Failure/Error: it { is_expected.to contain_file('monit_config').with_content(%r{#{content}}) } expected that the catalogue would contain File[monit_config] with content set to /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / but it is set to "# monitrc: Managed by puppet.\n#\nset daemon 120\nset logfile /var/log/monit.log\nset idfile /var/lib/monit/id\nset statefile /var/lib/monit/state\nset mail-format {\n from: [email protected]\n message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION\n subject: spectesting\n}\nset eventqueue\n basedir /var/lib/monit/events\n slots 100\n\ninclude /etc/monit/conf.d/*\n" Diff: @@ -1,7 +1,17 @@ -(?-mix:set mail-format { +# monitrc: Managed by puppet. +# +set daemon 120 +set logfile /var/log/monit.log +set idfile /var/lib/monit/id +set statefile /var/lib/monit/state +set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } -) +set eventqueue + basedir /var/lib/monit/events + slots 100 + +include /etc/monit/conf.d/*

Check failure on line 241 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

monit supported operating systems on scientific-7-x86_64 parameter functionality when mailformat is set to valid hash is expected to contain File[monit_config] with content =~ /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / Failure/Error: it { is_expected.to contain_file('monit_config').with_content(%r{#{content}}) } expected that the catalogue would contain File[monit_config] with content set to /set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } / but it is set to "# monitrc: Managed by puppet.\n#\nset daemon 120\nset logfile /var/log/monit.log\nset idfile /var/lib/monit/id\nset statefile /var/lib/monit/state\nset mail-format {\n from: [email protected]\n message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION\n subject: spectesting\n}\nset eventqueue\n basedir /var/lib/monit/events\n slots 100\n\ninclude /etc/monit.d/*\n" Diff: @@ -1,7 +1,17 @@ -(?-mix:set mail-format { +# monitrc: Managed by puppet. +# +set daemon 120 +set logfile /var/log/monit.log +set idfile /var/lib/monit/id +set statefile /var/lib/monit/state +set mail-format { from: [email protected] message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION subject: spectesting } -) +set eventqueue + basedir /var/lib/monit/events + slots 100 + +include /etc/monit.d/*
end
Expand All @@ -252,8 +252,8 @@
end

content = <<~END
|set alert [email protected]
|set alert [email protected]
set alert [email protected]
set alert [email protected]
END
it { is_expected.to contain_file('monit_config').with_content(%r{#{content}}) }
end
Expand Down
10 changes: 5 additions & 5 deletions spec/defines/check_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@

context 'with content set to a valid value' do
content = <<~END
|check process ntpd with pidfile /var/run/ntpd.pid
|start program = "/etc/init.d/ntpd start"
|stop program = "/etc/init.d/ntpd stop"
|if failed host 127.0.0.1 port 123 type udp then alert
|if 5 restarts within 5 cycles then timeout
check process ntpd with pidfile /var/run/ntpd.pid
start program = "/etc/init.d/ntpd start"
stop program = "/etc/init.d/ntpd stop"
if failed host 127.0.0.1 port 123 type udp then alert
if 5 restarts within 5 cycles then timeout
END
let(:params) do
{
Expand Down

0 comments on commit 7ded42e

Please sign in to comment.