Skip to content

Commit 541f285

Browse files
committed
rubocop: autofixes
1 parent c013bf0 commit 541f285

File tree

8 files changed

+39
-1
lines changed

8 files changed

+39
-1
lines changed

spec/classes/client_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
let(:facts) do
77
facts
88
end
9+
910
case facts[:osfamily]
1011
when 'Redhat'
1112
context 'with all defaults' do
@@ -25,6 +26,7 @@
2526
version: '3.6.1'
2627
}
2728
end
29+
2830
it 'includes gluster::install with version 3.6.1' do
2931
is_expected.to create_class('gluster::install').with(
3032
repo: true,
@@ -39,6 +41,7 @@
3941
repo: false
4042
}
4143
end
44+
4245
it 'includes gluster::install with repo=>false' do
4346
is_expected.to create_class('gluster::install').with(
4447
repo: false,
@@ -65,6 +68,7 @@
6568
version: '3.6.1'
6669
}
6770
end
71+
6872
it 'includes gluster::install with version 3.6.1' do
6973
is_expected.to create_class('gluster::install').with(
7074
repo: true,
@@ -79,6 +83,7 @@
7983
repo: false
8084
}
8185
end
86+
8287
it 'includes gluster::install with repo=>false' do
8388
is_expected.to create_class('gluster::install').with(
8489
repo: false,

spec/classes/init_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
let(:facts) do
77
facts
88
end
9+
910
case facts[:osfamily]
1011
when 'Redhat'
1112
context 'with all defaults' do
@@ -42,6 +43,7 @@
4243
repo: false
4344
}
4445
end
46+
4547
it 'creates gluster::install' do
4648
is_expected.to create_class('gluster::install').with(
4749
server: true,
@@ -97,6 +99,7 @@
9799
repo: false
98100
}
99101
end
102+
100103
it 'creates gluster::install' do
101104
is_expected.to create_class('gluster::install').with(
102105
server: true,
@@ -139,6 +142,7 @@
139142
}
140143
}
141144
end
145+
142146
it 'creates gluster::volume' do
143147
is_expected.to contain_gluster__volume('data1').with(
144148
name: 'data1',
@@ -152,9 +156,10 @@
152156
context 'when volumes incorrectly defined' do
153157
let :params do
154158
{
155-
volumes: { 'data1' => %w(this is an array) }
159+
volumes: { 'data1' => %w[this is an array] }
156160
}
157161
end
162+
158163
it 'fails' do
159164
expect do
160165
is_expected.to contain_gluster__volume('data1')

spec/classes/install_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
let :pre_condition do
1010
'require ::gluster::service'
1111
end
12+
1213
context 'with defaults' do
1314
it { is_expected.to compile.with_all_deps }
1415
case facts[:osfamily]
@@ -28,12 +29,14 @@
2829
let :params do
2930
{ repo: false }
3031
end
32+
3133
it { is_expected.not_to create_class('gluster::repo') }
3234
end
3335
context 'when client is false' do
3436
let :params do
3537
{ client: false }
3638
end
39+
3740
case facts[:osfamily]
3841
when 'Redhat'
3942
it { is_expected.not_to create_package('glusterfs-fuse') }
@@ -45,6 +48,7 @@
4548
let :params do
4649
{ server: false }
4750
end
51+
4852
case facts[:osfamily]
4953
when 'Redhat', 'Debian'
5054
it { is_expected.not_to create_package('glusterfs-server') }
@@ -56,6 +60,7 @@
5660
architecture: 'zLinux'
5761
)
5862
end
63+
5964
case facts[:osfamily]
6065
when 'Archlinux'
6166
it { is_expected.not_to create_class('gluster::repo') }

spec/classes/repo_apt_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
let :pre_condition do
1010
'require ::gluster::params'
1111
end
12+
1213
case facts[:osfamily]
1314
when 'Debian'
1415
context 'with all defaults' do
@@ -28,6 +29,7 @@
2829
architecture: 'zLinux'
2930
)
3031
end
32+
3133
it 'does not install' do
3234
expect do
3335
is_expected.to create_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-gluster.pub')
@@ -40,6 +42,7 @@
4042
priority: '700'
4143
}
4244
end
45+
4346
it 'installs' do
4447
is_expected.to contain_apt__source('glusterfs-LATEST').with(
4548
repos: 'main',
@@ -56,6 +59,7 @@
5659
release: '3.9'
5760
}
5861
end
62+
5963
it 'installs' do
6064
is_expected.to contain_apt__source('glusterfs-LATEST').with(
6165
repos: 'main',
@@ -75,6 +79,7 @@
7579
release: '3.6'
7680
}
7781
end
82+
7883
it 'installs' do
7984
is_expected.to contain_apt__source('glusterfs-LATEST').with(
8085
repos: 'main',
@@ -94,6 +99,7 @@
9499
release: '3.8'
95100
}
96101
end
102+
97103
it 'installs' do
98104
is_expected.to contain_apt__source('glusterfs-LATEST').with(
99105
repos: 'main',

spec/classes/repo_yum_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
let(:facts) do
77
facts
88
end
9+
910
case facts[:osfamily]
1011
when 'Redhat'
1112
context 'with all defaults' do
@@ -27,6 +28,7 @@
2728
version: 'foobar'
2829
}
2930
end
31+
3032
it 'does not install' do
3133
expect do
3234
is_expected.to create_file('/etc/yum.repos.d/glusterfs-x86_64.repo')
@@ -39,6 +41,7 @@
3941
architecture: 'zLinux'
4042
)
4143
end
44+
4245
it 'does not install' do
4346
expect do
4447
is_expected.to create_file('/etc/yum.repos.d/glusterfs-x86_64.repo')
@@ -51,6 +54,7 @@
5154
priority: '50'
5255
}
5356
end
57+
5458
it 'installs' do
5559
is_expected.to create_package('yum-plugin-priorities')
5660
is_expected.to create_yumrepo('glusterfs-x86_64').with(

spec/classes/service_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
let(:facts) do
77
facts
88
end
9+
910
context 'with all defaults' do
1011
it { is_expected.to compile.with_all_deps }
1112
it 'starts the service' do

spec/defines/peer_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
gluster_binary: '/usr/sbin/gluster'
1515
}
1616
end
17+
1718
it { is_expected.to compile }
1819
end
1920

@@ -26,6 +27,7 @@
2627
gluster_peer_list: 'peer1.example.com'
2728
}
2829
end
30+
2931
it { is_expected.to compile }
3032
it { is_expected.not_to contain_exec('gluster peer probe peer1.example.com') }
3133
end
@@ -37,6 +39,7 @@
3739
gluster_peer_list: 'peer1.example.com,peer2.example.com'
3840
}
3941
end
42+
4043
it { is_expected.to compile }
4144
it { is_expected.not_to contain_exec('gluster peer probe peer1.example.com') }
4245
end
@@ -51,6 +54,7 @@
5154
gluster_peer_list: ''
5255
}
5356
end
57+
5458
it { is_expected.to compile }
5559
it { is_expected.to contain_exec('gluster peer probe peer1.example.com') }
5660
end
@@ -62,6 +66,7 @@
6266
gluster_peer_list: 'peer2.example.com'
6367
}
6468
end
69+
6570
it { is_expected.to compile }
6671
it { is_expected.to contain_exec('gluster peer probe peer1.example.com') }
6772
end
@@ -73,6 +78,7 @@
7378
gluster_peer_list: 'peer2.example.com,peer3.example.com'
7479
}
7580
end
81+
7682
it { is_expected.to compile }
7783
it { is_expected.to contain_exec('gluster peer probe peer1.example.com') }
7884
end
@@ -87,6 +93,7 @@
8793
fqdn: 'peer1.example.com'
8894
}
8995
end
96+
9097
it { is_expected.to compile }
9198
it 'we don\'t try to join with ourselves' do
9299
is_expected.not_to contain_exec('gluster peer probe peer1.example.com')

spec/defines/volume_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
gluster_binary: '/usr/sbin/gluster'
3030
}
3131
end
32+
3233
it { is_expected.to compile.with_all_deps }
3334
end
3435

@@ -39,6 +40,7 @@
3940
gluster_peer_list: 'peer1.example.com,peer2.example.com'
4041
}
4142
end
43+
4244
it { is_expected.to compile.with_all_deps }
4345
end
4446

@@ -50,6 +52,7 @@
5052
gluster_volume_list: 'gl1.example.com:/glusterfs/backup,gl2.example.com:/glusterfs/backup'
5153
}
5254
end
55+
5356
it { is_expected.to compile.with_all_deps }
5457
end
5558
end
@@ -66,6 +69,7 @@
6669
let(:args) do
6770
'replica 2 transport tcp srv1.local:/export/brick1/brick srv2.local:/export/brick1/brick srv1.local:/export/brick2/brick srv2.local:/export/brick2/brick'
6871
end
72+
6973
it { is_expected.to compile.with_all_deps }
7074
it do
7175
is_expected.to contain_exec("gluster create volume #{title}").with(
@@ -81,6 +85,7 @@
8185
let(:args) do
8286
'replica 2 transport tcp srv1.local:/export/brick1/brick srv2.local:/export/brick1/brick srv1.local:/export/brick2/brick srv2.local:/export/brick2/brick force'
8387
end
88+
8489
it { is_expected.to compile.with_all_deps }
8590
it do
8691
is_expected.to contain_exec("gluster create volume #{title}").with(

0 commit comments

Comments
 (0)