From: david22swan Date: Wed, 26 Apr 2023 16:47:07 +0000 (+0100) Subject: (CONT-773) Rubocop Manual Fix 5 - RSpec/ContextWording X-Git-Tag: v9.1.0~9^2~2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=415881576484bc7bb06568b6ed8b41c7152d8599;p=puppet-modules%2Fpuppetlabs-apt.git (CONT-773) Rubocop Manual Fix 5 - RSpec/ContextWording --- diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e978cec..8b672ac 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -32,15 +32,6 @@ Metrics/MethodLength: Metrics/PerceivedComplexity: Max: 12 -# Offense count: 6 -# Configuration parameters: Prefixes, AllowedPatterns. -# Prefixes: when, with, without -RSpec/ContextWording: - Exclude: - - 'spec/classes/apt_spec.rb' - - 'spec/classes/apt_update_spec.rb' - - 'spec/unit/puppet/provider/apt_key_spec.rb' - # Offense count: 32 # Configuration parameters: IgnoredMetadata. RSpec/DescribeClass: diff --git a/spec/classes/apt_spec.rb b/spec/classes/apt_spec.rb index 0e6b6b0..12479b1 100644 --- a/spec/classes/apt_spec.rb +++ b/spec/classes/apt_spec.rb @@ -389,7 +389,7 @@ describe 'apt' do } facts_hash.each do |os, facts| - context "on #{os}" do + context "when on #{os}" do let(:facts) do facts end diff --git a/spec/classes/apt_update_spec.rb b/spec/classes/apt_update_spec.rb index ede2fe0..c46771a 100644 --- a/spec/classes/apt_update_spec.rb +++ b/spec/classes/apt_update_spec.rb @@ -62,7 +62,7 @@ describe 'apt::update', type: :class do end end - context 'and Exec[apt_update] refreshonly is overridden to true and has recent run' do + context 'when Exec[apt_update] refreshonly is overridden to true and has recent run' do let(:facts) do { os: { diff --git a/spec/unit/puppet/provider/apt_key_spec.rb b/spec/unit/puppet/provider/apt_key_spec.rb index 7cab6ce..d683c9b 100644 --- a/spec/unit/puppet/provider/apt_key_spec.rb +++ b/spec/unit/puppet/provider/apt_key_spec.rb @@ -15,7 +15,7 @@ describe Puppet::Type.type(:apt_key).provider(:apt_key) do end end - context 'self.instances no key' do + context 'with self.instances no key' do before :each do # Unable to remove `master` from below terminology as it relies on outside code allow(described_class).to receive(:apt_key).with( @@ -28,7 +28,7 @@ describe Puppet::Type.type(:apt_key).provider(:apt_key) do end end - context 'self.instances multiple keys' do + context 'with self.instances multiple keys' do before :each do command_output = <<~OUTPUT Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.DU0GdRxjmE --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/puppetlabs-pc1-keyring.gpg --no-tty --list-keys --with-colons --fingerprint --fixed-list-mode @@ -54,7 +54,7 @@ describe Puppet::Type.type(:apt_key).provider(:apt_key) do end end - context 'create apt_key resource' do + context 'with create apt_key resource' do it 'apt_key with content set and source nil' do expect(described_class).to receive(:apt_key).with(['adv', '--no-tty', '--keyserver', @@ -172,7 +172,7 @@ describe Puppet::Type.type(:apt_key).provider(:apt_key) do end end - context 'key_line_hash function' do + context 'with key_line_hash function' do it 'matches rsa' do expect(described_class.key_line_hash('pub:-:1024:1:40976EAF437D05B5:1095016255:::-:::scESC:', 'fpr:::::::::630239CC130E1A7FD81A27B140976EAF437D05B5:')).to include( key_expiry: nil,