Skip to content

Commit eed0313

Browse files
committed
(MAINT) Rubocop fixes for puppet-lint/plugins
1 parent 0c40403 commit eed0313

37 files changed

+562
-562
lines changed

spec/puppet-lint/plugins/check_classes/arrow_on_right_operand_line_spec.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
END
1313
end
1414

15-
it 'should not detect any problems' do
15+
it 'does not detect any problems' do
1616
expect(problems).to have(0).problems
1717
end
1818
end
@@ -25,20 +25,20 @@
2525
END
2626
end
2727

28-
it 'should detect a problem' do
28+
it 'detects a problem' do
2929
expect(problems).to have(1).problem
3030
end
3131

32-
it 'should create a warning' do
32+
it 'creates a warning' do
3333
expect(problems).to contain_warning(msg).on_line(1).in_column(31)
3434
end
3535

3636
context 'with fix enabled' do
37-
before do
37+
before(:each) do
3838
PuppetLint.configuration.fix = true
3939
end
4040

41-
after do
41+
after(:each) do
4242
PuppetLint.configuration.fix = false
4343
end
4444

@@ -49,11 +49,11 @@
4949
END
5050
end
5151

52-
it 'should fix the problem' do
52+
it 'fixes the problem' do
5353
expect(problems).to contain_fixed(msg).on_line(1).in_column(31)
5454
end
5555

56-
it 'should move the arrow to before the right operand' do
56+
it 'moves the arrow to before the right operand' do
5757
expect(manifest).to eq(fixed)
5858
end
5959
end
@@ -67,7 +67,7 @@
6767
END
6868
end
6969

70-
it 'should not detect any problems' do
70+
it 'does not detect any problems' do
7171
expect(problems).to have(0).problems
7272
end
7373
end
@@ -83,11 +83,11 @@
8383
END
8484
end
8585

86-
it 'should detect a problem' do
86+
it 'detects a problem' do
8787
expect(problems).to have(1).problem
8888
end
8989

90-
it 'should create a warning' do
90+
it 'creates a warning' do
9191
expect(problems).to contain_warning(msg).on_line(1).in_column(30)
9292
end
9393

@@ -110,11 +110,11 @@
110110
END
111111
end
112112

113-
it 'should fix the problem' do
113+
it 'fixes the problem' do
114114
expect(problems).to contain_fixed(msg).on_line(1).in_column(30)
115115
end
116116

117-
it 'should move the arrow to before the right operand' do
117+
it 'moves the arrow to before the right operand' do
118118
expect(manifest).to eq(fixed)
119119
end
120120
end
@@ -128,11 +128,11 @@
128128
END
129129
end
130130

131-
it 'should detect a problem' do
131+
it 'detects a problem' do
132132
expect(problems).to have(1).problem
133133
end
134134

135-
it 'should create a warning' do
135+
it 'creates a warning' do
136136
expect(problems).to contain_warning(msg).on_line(1).in_column(30)
137137
end
138138

@@ -152,11 +152,11 @@
152152
END
153153
end
154154

155-
it 'should fix the problem' do
155+
it 'fixes the problem' do
156156
expect(problems).to contain_fixed(msg).on_line(1).in_column(30)
157157
end
158158

159-
it 'should move the arrow to before the right operand' do
159+
it 'moves the arrow to before the right operand' do
160160
expect(manifest).to eq(fixed)
161161
end
162162
end

spec/puppet-lint/plugins/check_classes/autoloader_layout_spec.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let(:code) { 'class foo::bar { }' }
66
let(:path) { 'foo/manifests/bar.pp' }
77

8-
it 'should not detect any problems' do
8+
it 'does not detect any problems' do
99
expect(problems).to have(0).problems
1010
end
1111
end
@@ -14,7 +14,7 @@
1414
let(:code) { 'define foo::bar::baz() { }' }
1515
let(:path) { 'foo/manifests/bar/baz.pp' }
1616

17-
it 'should not detect any problems' do
17+
it 'does not detect any problems' do
1818
expect(problems).to have(0).problems
1919
end
2020
end
@@ -23,7 +23,7 @@
2323
let(:code) { 'class foo { }' }
2424
let(:path) { 'foo/manifests/init.pp' }
2525

26-
it 'should not detect any problems' do
26+
it 'does not detect any problems' do
2727
expect(problems).to have(0).problems
2828
end
2929
end
@@ -33,11 +33,11 @@
3333
let(:path) { 'foo/manifests/init.pp' }
3434
let(:msg) { 'foo::bar not in autoload module layout' }
3535

36-
it 'should only detect a single problem' do
36+
it 'only detects a single problem' do
3737
expect(problems).to have(1).problem
3838
end
3939

40-
it 'should create an error' do
40+
it 'creates an error' do
4141
expect(problems).to contain_error(msg).on_line(1).in_column(7)
4242
end
4343
end
@@ -55,7 +55,7 @@ class {'foo':
5555

5656
let(:path) { 'bar/manifests/init.pp' }
5757

58-
it 'should not detect any problems' do
58+
it 'does not detect any problems' do
5959
expect(problems).to have(0).problems
6060
end
6161
end
@@ -64,41 +64,41 @@ class {'foo':
6464
let(:code) { 'class foo { }' }
6565
let(:path) { 'puppet-foo/manifests/init.pp' }
6666

67-
it 'should detect a single problem' do
67+
it 'detects a single problem' do
6868
expect(problems).to have(1).problems
6969
end
7070
end
7171

7272
context 'foo in puppet-foo/manifests/bar.pp with relative option' do
73-
before do
73+
before(:each) do
7474
PuppetLint.configuration.relative = true
7575
end
7676

77-
after do
77+
after(:each) do
7878
PuppetLint.configuration.relative = false
7979
end
8080

8181
let(:code) { 'class foo { }' }
8282
let(:path) { 'puppet-foo/manifests/bar.pp' }
8383

84-
it 'should detect a single problem' do
84+
it 'detects a single problem' do
8585
expect(problems).to have(1).problems
8686
end
8787
end
8888

8989
context 'foo in puppet-foo/manifests/init.pp with relative option' do
90-
before do
90+
before(:each) do
9191
PuppetLint.configuration.relative = true
9292
end
9393

94-
after do
94+
after(:each) do
9595
PuppetLint.configuration.relative = false
9696
end
9797

9898
let(:code) { 'class foo { }' }
9999
let(:path) { 'puppet-foo/manifests/init.pp' }
100100

101-
it 'should not detect any problems' do
101+
it 'does not detect any problems' do
102102
expect(problems).to have(0).problems
103103
end
104104
end

spec/puppet-lint/plugins/check_classes/class_inherits_from_params_class_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ class foo($bar = $name) inherits foo::params { }
1111
END
1212
end
1313

14-
it 'should only detect a single problem' do
14+
it 'only detects a single problem' do
1515
expect(problems).to have(1).problem
1616
end
1717

18-
it 'should create a warning' do
18+
it 'creates a warning' do
1919
expect(problems).to contain_warning(msg).on_line(2).in_column(42)
2020
end
2121
end
@@ -32,7 +32,7 @@ class myclass {
3232
END
3333
end
3434

35-
it 'should not detect any problems' do
35+
it 'does not detect any problems' do
3636
expect(problems).to have(0).problems
3737
end
3838
end

spec/puppet-lint/plugins/check_classes/code_on_top_scope_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class foo:bar {
1010
END
1111
end
1212

13-
its(:problems) { should be_empty }
13+
its(:problems) { is_expected.to be_empty }
1414
end
1515

1616
describe 'new lines outside of class-define block' do
@@ -23,7 +23,7 @@ class foo:bar {
2323
END
2424
end
2525

26-
its(:problems) { should be_empty }
26+
its(:problems) { is_expected.to be_empty }
2727
end
2828

2929
describe 'code outside class block' do
@@ -41,8 +41,8 @@ class foo:bar {
4141
end
4242

4343
its(:problems) do
44-
should contain_warning('code outside of class or define block - include')
45-
should have(4).problems
44+
is_expected.to contain_warning('code outside of class or define block - include')
45+
is_expected.to have(4).problems
4646
end
4747
end
4848
end

spec/puppet-lint/plugins/check_classes/inherits_across_namespaces_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@
66
context 'class inheriting from parent in same module namespace' do
77
let(:code) { 'class foo::bar inherits foo { }' }
88

9-
it 'should not detect any problems' do
9+
it 'does not detect any problems' do
1010
expect(problems).to have(0).problems
1111
end
1212
end
1313

1414
context 'class inheriting from sister in same module namespace' do
1515
let(:code) { 'class foo::bar inherits foo::baz { }' }
1616

17-
it 'should not detect any problems' do
17+
it 'does not detect any problems' do
1818
expect(problems).to have(0).problems
1919
end
2020
end
2121

2222
context 'class inheriting from another module namespace' do
2323
let(:code) { 'class foo::bar inherits baz { }' }
2424

25-
it 'should only detect a single problem' do
25+
it 'only detects a single problem' do
2626
expect(problems).to have(1).problem
2727
end
2828

29-
it 'should create a warning' do
29+
it 'creates a warning' do
3030
expect(problems).to contain_warning(msg).on_line(1).in_column(25)
3131
end
3232
end

spec/puppet-lint/plugins/check_classes/name_contains_uppercase_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
let(:path) { 'foobar/manifests/init.pp' }
77
let(:class_msg) { "defined type 'FooBar' contains illegal uppercase" }
88

9-
it 'should only detect a single problem' do
9+
it 'only detects a single problem' do
1010
expect(problems).to have(1).problem
1111
end
1212

13-
it 'should create an error' do
13+
it 'creates an error' do
1414
expect(problems).to contain_error(class_msg).on_line(1).in_column(8)
1515
end
1616
end
@@ -20,11 +20,11 @@
2020
let(:path) { 'foobar/manifests/init.pp' }
2121
let(:class_msg) { "class 'FooBar' contains illegal uppercase" }
2222

23-
it 'should only detect a single problem' do
23+
it 'only detects a single problem' do
2424
expect(problems).to have(1).problem
2525
end
2626

27-
it 'should create an error' do
27+
it 'creates an error' do
2828
expect(problems).to contain_error(class_msg).on_line(1).in_column(7)
2929
end
3030
end
@@ -34,30 +34,30 @@
3434
let(:path) { 'foo/manifests/barfoo.pp' }
3535
let(:class_msg) { "class 'Foo::BarFoo' contains illegal uppercase" }
3636

37-
it 'should only detect a single problem' do
37+
it 'only detects a single problem' do
3838
expect(problems).to have(1).problem
3939
end
4040

41-
it 'should create an error' do
41+
it 'creates an error' do
4242
expect(problems).to contain_error(class_msg).on_line(1).in_column(7)
4343
end
4444

4545
context 'check fix -' do
46-
before do
46+
before(:each) do
4747
PuppetLint.configuration.fix = true
4848
end
4949

50-
after do
50+
after(:each) do
5151
PuppetLint.configuration.fix = false
5252
end
5353

5454
let(:fixed) { code.downcase }
5555

56-
it 'should create an error' do
56+
it 'creates an error' do
5757
expect(problems).to contain_fixed(class_msg).on_line(1).in_column(7)
5858
end
5959

60-
it 'should downcase the class name' do
60+
it 'downcases the class name' do
6161
expect(manifest).to eq(fixed)
6262
end
6363
end

0 commit comments

Comments
 (0)