Skip to content

Commit 4158815

Browse files
committed
(CONT-773) Rubocop Manual Fix 5 - RSpec/ContextWording
1 parent 46c9475 commit 4158815

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@ Metrics/MethodLength:
3232
Metrics/PerceivedComplexity:
3333
Max: 12
3434

35-
# Offense count: 6
36-
# Configuration parameters: Prefixes, AllowedPatterns.
37-
# Prefixes: when, with, without
38-
RSpec/ContextWording:
39-
Exclude:
40-
- 'spec/classes/apt_spec.rb'
41-
- 'spec/classes/apt_update_spec.rb'
42-
- 'spec/unit/puppet/provider/apt_key_spec.rb'
43-
4435
# Offense count: 32
4536
# Configuration parameters: IgnoredMetadata.
4637
RSpec/DescribeClass:

spec/classes/apt_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@
389389
}
390390

391391
facts_hash.each do |os, facts|
392-
context "on #{os}" do
392+
context "when on #{os}" do
393393
let(:facts) do
394394
facts
395395
end

spec/classes/apt_update_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
end
6363
end
6464

65-
context 'and Exec[apt_update] refreshonly is overridden to true and has recent run' do
65+
context 'when Exec[apt_update] refreshonly is overridden to true and has recent run' do
6666
let(:facts) do
6767
{
6868
os: {

spec/unit/puppet/provider/apt_key_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
end
1616
end
1717

18-
context 'self.instances no key' do
18+
context 'with self.instances no key' do
1919
before :each do
2020
# Unable to remove `master` from below terminology as it relies on outside code
2121
allow(described_class).to receive(:apt_key).with(
@@ -28,7 +28,7 @@
2828
end
2929
end
3030

31-
context 'self.instances multiple keys' do
31+
context 'with self.instances multiple keys' do
3232
before :each do
3333
command_output = <<~OUTPUT
3434
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 @@
5454
end
5555
end
5656

57-
context 'create apt_key resource' do
57+
context 'with create apt_key resource' do
5858
it 'apt_key with content set and source nil' do
5959
expect(described_class).to receive(:apt_key).with(['adv', '--no-tty',
6060
'--keyserver',
@@ -172,7 +172,7 @@
172172
end
173173
end
174174

175-
context 'key_line_hash function' do
175+
context 'with key_line_hash function' do
176176
it 'matches rsa' do
177177
expect(described_class.key_line_hash('pub:-:1024:1:40976EAF437D05B5:1095016255:::-:::scESC:', 'fpr:::::::::630239CC130E1A7FD81A27B140976EAF437D05B5:')).to include(
178178
key_expiry: nil,

0 commit comments

Comments
 (0)