Skip to content

Commit 30bd33d

Browse files
author
Joshua Hoblitt
committed
replace rspec include_class matcher with contain_class
To fix this warning with rspec-puppet >= 1.0.0: DEPRECATION: include_class is deprecated. Use contain_class instead
1 parent 0795ca3 commit 30bd33d

7 files changed

+28
-28
lines changed

spec/classes/config_ldap_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
let(:params) { params }
2525

2626
it do
27-
should include_class('pureftpd::config::ldap')
27+
should contain_class('pureftpd::config::ldap')
2828
should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \
2929
.with_ensure('file') \
3030
.with_content(content)
@@ -65,7 +65,7 @@
6565
let(:params) {{ :foo => 'bar' }}
6666

6767
it 'should fail' do
68-
expect { should include_class('pureftpd::config::ldap') }.
68+
expect { should contain_class('pureftpd::config::ldap') }.
6969
to raise_error(Puppet::Error, /Invalid parameter foo/)
7070
end
7171
end

spec/classes/config_mysql_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
let(:params) { params }
3232

3333
it do
34-
should include_class('pureftpd::config::mysql')
34+
should contain_class('pureftpd::config::mysql')
3535
should contain_file('/etc/pure-ftpd/pureftpd-mysql.conf') \
3636
.with_ensure('file') \
3737
.with_content(content)
@@ -72,7 +72,7 @@
7272
let(:params) {{ :foo => 'bar' }}
7373

7474
it 'should fail' do
75-
expect { should include_class('pureftpd::config::mysql') }.
75+
expect { should contain_class('pureftpd::config::mysql') }.
7676
to raise_error(Puppet::Error, /Invalid parameter foo/)
7777
end
7878
end

spec/classes/config_pgsql_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
let(:params) { params }
2929

3030
it do
31-
should include_class('pureftpd::config::pgsql')
31+
should contain_class('pureftpd::config::pgsql')
3232
should contain_file('/etc/pure-ftpd/pureftpd-pgsql.conf') \
3333
.with_ensure('file') \
3434
.with_content(content)
@@ -69,7 +69,7 @@
6969
let(:params) {{ :foo => 'bar' }}
7070

7171
it 'should fail' do
72-
expect { should include_class('pureftpd::config::pgsql') }.
72+
expect { should contain_class('pureftpd::config::pgsql') }.
7373
to raise_error(Puppet::Error, /Invalid parameter foo/)
7474
end
7575
end

spec/classes/config_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
let(:params) { params }
7373

7474
it do
75-
should include_class('pureftpd::config')
75+
should contain_class('pureftpd::config')
7676
should contain_file('/etc/pure-ftpd/pure-ftpd.conf') \
7777
.with_ensure('file') \
7878
.with_content(content)
@@ -113,7 +113,7 @@
113113
let(:params) {{ :foo => 'bar' }}
114114

115115
it 'should fail' do
116-
expect { should include_class('pureftpd::config') }.
116+
expect { should contain_class('pureftpd::config') }.
117117
to raise_error(Puppet::Error, /Invalid parameter foo/)
118118
end
119119
end

spec/classes/install_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
let(:facts) {{ :osfamily => 'RedHat' }}
66

77
describe 'no params' do
8-
it { should include_class('pureftpd::install') }
8+
it { should contain_class('pureftpd::install') }
99
it { should contain_package('pure-ftpd').with_ensure('present') }
1010
it { should_not contain_package('pure-ftpd-selinux').with_ensure('present') }
1111
end
1212

1313
describe 'use_selinux = false' do
1414
let(:params) {{ :use_selinux => false }}
1515

16-
it { should include_class('pureftpd::install') }
16+
it { should contain_class('pureftpd::install') }
1717
it { should contain_package('pure-ftpd').with_ensure('present') }
1818
it { should_not contain_package('pure-ftpd-selinux').with_ensure('present') }
1919
end
2020

2121
describe 'use_selinux = true' do
2222
let(:params) {{ :use_selinux => true }}
2323

24-
it { should include_class('pureftpd::install') }
24+
it { should contain_class('pureftpd::install') }
2525
it { should contain_package('pure-ftpd').with_ensure('present') }
2626
it { should contain_package('pure-ftpd-selinux').with_ensure('present') }
2727
end
@@ -30,7 +30,7 @@
3030
let(:params) {{ :use_selinux => 'foo' }}
3131

3232
it 'should fail' do
33-
expect { should include_class('pureftpd::install') }.
33+
expect { should contain_class('pureftpd::install') }.
3434
to raise_error(Puppet::Error, /not a boolean/)
3535
end
3636
end

spec/classes/params_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
describe 'for osfamily RedHat' do
55
let(:facts) {{ :osfamily => 'RedHat' }}
66

7-
it { should include_class('pureftpd::params') }
7+
it { should contain_class('pureftpd::params') }
88
end
99

1010
describe 'unsupported osfamily' do
@@ -16,7 +16,7 @@
1616
end
1717

1818
it 'should fail' do
19-
expect { should include_class('pureftpd::params') }.
19+
expect { should contain_class('pureftpd::params') }.
2020
to raise_error(Puppet::Error, /not supported on Debian/)
2121
end
2222
end

spec/classes/pureftpd_spec.rb

+14-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
let(:facts) { {:osfamily=> 'RedHat'} }
55

66
describe 'with no params' do
7-
it { should include_class('pureftpd') }
7+
it { should contain_class('pureftpd') }
88
it { should contain_class('pureftpd::install') }
99
it do
1010
should contain_class('pureftpd::config').
@@ -19,7 +19,7 @@
1919
describe 'with $use_selinux => true' do
2020
let(:params) {{ :use_selinux => true }}
2121

22-
it { should include_class('pureftpd') }
22+
it { should contain_class('pureftpd') }
2323
it { should contain_class('pureftpd::install').with_use_selinux(true) }
2424
it do
2525
should contain_class('pureftpd::config').
@@ -34,7 +34,7 @@
3434
describe 'with $use_selinux => false' do
3535
let(:params) {{ :use_selinux => false }}
3636

37-
it { should include_class('pureftpd') }
37+
it { should contain_class('pureftpd') }
3838
it { should contain_class('pureftpd::install').with_use_selinux(false) }
3939
it do
4040
should contain_class('pureftpd::config').
@@ -51,15 +51,15 @@
5151

5252
it 'should fail' do
5353
expect {
54-
should include_class('pureftpd')
54+
should contain_class('pureftpd')
5555
}.to raise_error(Puppet::Error, /is not a boolean/)
5656
end
5757
end
5858

5959
describe 'with $config => {}' do
6060
let(:params) {{ :config => {} }}
6161

62-
it { should include_class('pureftpd') }
62+
it { should contain_class('pureftpd') }
6363
it { should contain_class('pureftpd::install') }
6464
it do
6565
should contain_class('pureftpd::config').
@@ -79,7 +79,7 @@
7979
}
8080
}}
8181

82-
it { should include_class('pureftpd') }
82+
it { should contain_class('pureftpd') }
8383
it { should contain_class('pureftpd::install') }
8484
it do
8585
should contain_class('pureftpd::config').
@@ -100,7 +100,7 @@
100100

101101
it 'should fail' do
102102
expect {
103-
should include_class('pureftpd')
103+
should contain_class('pureftpd')
104104
}.to raise_error(Puppet::Error, /is not a Hash/)
105105
end
106106
end
@@ -115,7 +115,7 @@
115115
}
116116
end
117117

118-
it { should include_class('pureftpd') }
118+
it { should contain_class('pureftpd') }
119119
it { should contain_class('pureftpd::install') }
120120
it do
121121
should contain_class('pureftpd::config').
@@ -139,7 +139,7 @@
139139

140140
it 'should fail' do
141141
expect {
142-
should include_class('pureftpd')
142+
should contain_class('pureftpd')
143143
}.to raise_error(Puppet::Error, /is not a Hash/)
144144
end
145145
end
@@ -154,7 +154,7 @@
154154
}
155155
end
156156

157-
it { should include_class('pureftpd') }
157+
it { should contain_class('pureftpd') }
158158
it { should contain_class('pureftpd::install') }
159159
it do
160160
should contain_class('pureftpd::config').
@@ -178,7 +178,7 @@
178178

179179
it 'should fail' do
180180
expect {
181-
should include_class('pureftpd')
181+
should contain_class('pureftpd')
182182
}.to raise_error(Puppet::Error, /is not a Hash/)
183183
end
184184
end
@@ -193,7 +193,7 @@
193193
}
194194
end
195195

196-
it { should include_class('pureftpd') }
196+
it { should contain_class('pureftpd') }
197197
it { should contain_class('pureftpd::install') }
198198
it do
199199
should contain_class('pureftpd::config').
@@ -217,7 +217,7 @@
217217

218218
it 'should fail' do
219219
expect {
220-
should include_class('pureftpd')
220+
should contain_class('pureftpd')
221221
}.to raise_error(Puppet::Error, /is not a Hash/)
222222
end
223223
end
@@ -241,7 +241,7 @@
241241
}
242242
end
243243

244-
it { should include_class('pureftpd') }
244+
it { should contain_class('pureftpd') }
245245
it { should contain_class('pureftpd::install') }
246246
it do
247247
should contain_class('pureftpd::config').

0 commit comments

Comments
 (0)