Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rubocop corrections #41

Merged
merged 3 commits into from
Dec 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
rubocop:auto_correct fixes
traylenator committed Dec 8, 2020
commit 7e5b657a58fc94f81a6cc21a54d21023cee3bebb
2 changes: 1 addition & 1 deletion spec/classes/inet_filter_spec.rb
Original file line number Diff line number Diff line change
@@ -441,7 +441,7 @@
end

context 'custom log prefix with variable substitution' do
let(:pre_condition) { 'class{\'nftables\': log_prefix => " bar [%<chain>s] "}' } # rubocop:disable Style/FormatStringToken
let(:pre_condition) { 'class{\'nftables\': log_prefix => " bar [%<chain>s] "}' }

it {
is_expected.to contain_concat__fragment('nftables-inet-filter-chain-INPUT-rule-log_discarded').with(
20 changes: 10 additions & 10 deletions spec/classes/nftables_spec.rb
Original file line number Diff line number Diff line change
@@ -177,8 +177,8 @@

context 'with no nftables fact' do
it {
is_expected.to contain_systemd__dropin_file('puppet_nft.conf')
.with_content(%r{^ExecReload.*flush ruleset; include.*$})
is_expected.to contain_systemd__dropin_file('puppet_nft.conf').
with_content(%r{^ExecReload.*flush ruleset; include.*$})
}
it { is_expected.to contain_file('/etc/nftables/puppet-preflight.nft').with_content(%r{^flush ruleset$}) }
end
@@ -189,12 +189,12 @@
end

it {
is_expected.to contain_systemd__dropin_file('puppet_nft.conf')
.with_content(%r{^ExecReload.*flush table inet abc; include.*$})
is_expected.to contain_systemd__dropin_file('puppet_nft.conf').
with_content(%r{^ExecReload.*flush table inet abc; include.*$})
}
it {
is_expected.to contain_file('/etc/nftables/puppet-preflight.nft')
.with_content(%r{^flush table inet abc$})
is_expected.to contain_file('/etc/nftables/puppet-preflight.nft').
with_content(%r{^flush table inet abc$})
}
end
context 'with nftables fact not matching' do
@@ -203,12 +203,12 @@
end

it {
is_expected.to contain_systemd__dropin_file('puppet_nft.conf')
.with_content(%r{^ExecReload.*flush table inet abc; flush table inet ijk; include.*$})
is_expected.to contain_systemd__dropin_file('puppet_nft.conf').
with_content(%r{^ExecReload.*flush table inet abc; flush table inet ijk; include.*$})
}
it {
is_expected.to contain_file('/etc/nftables/puppet-preflight.nft')
.with_content(%r{^flush table inet abc; flush table inet ijk$})
is_expected.to contain_file('/etc/nftables/puppet-preflight.nft').
with_content(%r{^flush table inet abc; flush table inet ijk$})
}
end
end
2 changes: 1 addition & 1 deletion spec/defines/set_spec.rb
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@
let(:params) do
{
type: 'ipv4_addr',
flags: ['interval', 'timeout'],
flags: %w[interval timeout],
elements: ['192.168.0.1/24'],
auto_merge: true,
}
2 changes: 1 addition & 1 deletion spec/unit/facter/nftables_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

describe 'nftables' do
before(:each) do
before do
Facter.clear
Process.stubs(:uid).returns(0)
Facter::Util::Resolution.stubs(:which).with('nft').returns('/usr/sbin/nft')