Skip to content

Commit

Permalink
rubocop: autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed May 26, 2017
1 parent bfd81f1 commit dc90226
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 32 deletions.
6 changes: 4 additions & 2 deletions spec/classes/collectd_plugin_curl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
is_expected.to contain_file("#{options[:plugin_conf_dir]}/curl-stocks_ILD.conf").with(
ensure: 'present',
path: "#{options[:plugin_conf_dir]}/curl-stocks_ILD.conf",
content: "<Plugin curl>\n <Page \"stocks_ILD\">\n URL \"http://finance.google.com/finance?q=EPA%3AILD\"\n User \"foo\"\n Password \"bar\"\n <Match>\n Regex \"]*> *([0-9]*\\.[0-9]+) *\"\n DSType \"GaugeAverage\"\n Type \"stock_value\"\n Instance \"ILD\"\n </Match>\n\n </Page>\n</Plugin>\n")
content: "<Plugin curl>\n <Page \"stocks_ILD\">\n URL \"http://finance.google.com/finance?q=EPA%3AILD\"\n User \"foo\"\n Password \"bar\"\n <Match>\n Regex \"]*> *([0-9]*\\.[0-9]+) *\"\n DSType \"GaugeAverage\"\n Type \"stock_value\"\n Instance \"ILD\"\n </Match>\n\n </Page>\n</Plugin>\n"
)
end
end

Expand All @@ -72,7 +73,8 @@
is_expected.to contain_file("#{options[:plugin_conf_dir]}/curl-selfsigned_ssl.conf").with(
ensure: 'present',
path: "#{options[:plugin_conf_dir]}/curl-selfsigned_ssl.conf",
content: "<Plugin curl>\n <Page \"selfsigned_ssl\">\n URL \"https://some.selfsigned.ssl.site/\"\n VerifyPeer false\n VerifyHost false\n MeasureResponseTime true\n </Page>\n</Plugin>\n")
content: "<Plugin curl>\n <Page \"selfsigned_ssl\">\n URL \"https://some.selfsigned.ssl.site/\"\n VerifyPeer false\n VerifyHost false\n MeasureResponseTime true\n </Page>\n</Plugin>\n"
)
end
end

Expand Down
3 changes: 1 addition & 2 deletions spec/classes/collectd_plugin_exec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
'user' => 'nobody',
'group' => 'users',
'exec' => ['/bin/echo', 'hello world']
}
}
} }
}
end

Expand Down
1 change: 0 additions & 1 deletion spec/classes/collectd_plugin_load_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
facts
end

options = os_specific_options(facts)
let :pre_condition do
'include ::collectd'
end
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/collectd_plugin_python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
is_expected.to contain_concat__fragment('collectd_plugin_python_conf_elasticsearch').with(
content: %r{Cluster "Another-ES-clust"},
target: "#{options[:plugin_conf_dir]}/python-config.conf"
)
)
end

it 'created collectd plugin file' do
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/collectd_plugin_swap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

it 'Will create /etc/collectd.d/10-swap.conf' do
is_expected.to contain_file('swap.load').with(
ensure: 'present',
path: "#{options[:plugin_conf_dir]}/10-swap.conf",
content: %r{# Generated by Puppet\nLoadPlugin swap\n\n<Plugin swap>\n ReportByDevice false\n</Plugin>\n}
ensure: 'present',
path: "#{options[:plugin_conf_dir]}/10-swap.conf",
content: %r{# Generated by Puppet\nLoadPlugin swap\n\n<Plugin swap>\n ReportByDevice false\n</Plugin>\n}
)
end
end
Expand Down
31 changes: 15 additions & 16 deletions spec/classes/collectd_plugin_varnish_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
end

it 'renders the template with the default values' do
content = <<EOS
content = <<EOS
<Plugin varnish>
<Instance "localhost">
</Instance>
Expand All @@ -32,7 +32,7 @@
end

it 'renders the template with the default values' do
content = <<EOS
content = <<EOS
<Plugin varnish>
<Instance "localhost">
</Instance>
Expand All @@ -48,31 +48,30 @@
end

context 'when there are no params given' do

it 'renders the template with the default values' do
content = <<EOS
<Plugin varnish>
<Instance "localhost">
</Instance>
</Plugin>
EOS
is_expected.to contain_collectd__plugin('varnish').with_content(content)
is_expected.to contain_collectd__plugin('varnish').with_content(content)
end
end
end
context 'when there are params given' do
let :params do
{
'instances' => {
'warble' => {
'BATMAN' => true,
'Robin' => false
context 'when there are params given' do
let :params do
{
'instances' => {
'warble' => {
'BATMAN' => true,
'Robin' => false
}
}
}
}
end
end

it 'renders the template with the values passed in the params' do
content = <<EOS
it 'renders the template with the values passed in the params' do
content = <<EOS
<Plugin varnish>
<Instance "warble">
BATMAN true
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/collectd_plugin_virt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
context "on #{os} " do
let :facts do
facts
end
end

let :pre_condition do
'include ::collectd'
Expand Down Expand Up @@ -43,7 +43,7 @@

context 'with collectd_version >= 5.5' do
let :facts do
facts.merge(collectd_version: '5.5.0')
facts.merge(collectd_version: '5.5.0')
end

it 'is included' do
Expand Down
1 change: 0 additions & 1 deletion spec/defines/collectd_plugin_filter_chain_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'spec_helper'

describe 'collectd::plugin::filter::chain', type: :define do

on_supported_os.each do |os, facts|
context "on #{os} " do
let :facts do
Expand Down
4 changes: 2 additions & 2 deletions spec/defines/collectd_plugin_mysql_database_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
facts
end

options = os_specific_options(facts)
options = os_specific_options(facts)

let :pre_condition do
let :pre_condition do
'include ::collectd'
end

Expand Down
2 changes: 1 addition & 1 deletion spec/defines/collectd_plugin_snmp_host_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
context "on #{os} " do
let :facts do
facts
end
end

options = os_specific_options(facts)
let(:title) { 'foo.example.com' }
Expand Down
1 change: 0 additions & 1 deletion spec/defines/collectd_typesdb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
facts
end

options = os_specific_options(facts)
context 'without any types' do
let(:title) { '/etc/collectd/types.db' }

Expand Down

0 comments on commit dc90226

Please sign in to comment.