Skip to content

Commit

Permalink
replace rspec include_class matcher with contain_class
Browse files Browse the repository at this point in the history
To fix this warning with rspec-puppet >= 1.0.0:

    DEPRECATION: include_class is deprecated. Use contain_class instead
  • Loading branch information
Joshua Hoblitt committed Apr 8, 2014
1 parent 0795ca3 commit 30bd33d
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions spec/classes/config_ldap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
let(:params) { params }

it do
should include_class('pureftpd::config::ldap')
should contain_class('pureftpd::config::ldap')
should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \
.with_ensure('file') \
.with_content(content)
Expand Down Expand Up @@ -65,7 +65,7 @@
let(:params) {{ :foo => 'bar' }}

it 'should fail' do
expect { should include_class('pureftpd::config::ldap') }.
expect { should contain_class('pureftpd::config::ldap') }.
to raise_error(Puppet::Error, /Invalid parameter foo/)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/config_mysql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
let(:params) { params }

it do
should include_class('pureftpd::config::mysql')
should contain_class('pureftpd::config::mysql')
should contain_file('/etc/pure-ftpd/pureftpd-mysql.conf') \
.with_ensure('file') \
.with_content(content)
Expand Down Expand Up @@ -72,7 +72,7 @@
let(:params) {{ :foo => 'bar' }}

it 'should fail' do
expect { should include_class('pureftpd::config::mysql') }.
expect { should contain_class('pureftpd::config::mysql') }.
to raise_error(Puppet::Error, /Invalid parameter foo/)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/config_pgsql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
let(:params) { params }

it do
should include_class('pureftpd::config::pgsql')
should contain_class('pureftpd::config::pgsql')
should contain_file('/etc/pure-ftpd/pureftpd-pgsql.conf') \
.with_ensure('file') \
.with_content(content)
Expand Down Expand Up @@ -69,7 +69,7 @@
let(:params) {{ :foo => 'bar' }}

it 'should fail' do
expect { should include_class('pureftpd::config::pgsql') }.
expect { should contain_class('pureftpd::config::pgsql') }.
to raise_error(Puppet::Error, /Invalid parameter foo/)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
let(:params) { params }

it do
should include_class('pureftpd::config')
should contain_class('pureftpd::config')
should contain_file('/etc/pure-ftpd/pure-ftpd.conf') \
.with_ensure('file') \
.with_content(content)
Expand Down Expand Up @@ -113,7 +113,7 @@
let(:params) {{ :foo => 'bar' }}

it 'should fail' do
expect { should include_class('pureftpd::config') }.
expect { should contain_class('pureftpd::config') }.
to raise_error(Puppet::Error, /Invalid parameter foo/)
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
let(:facts) {{ :osfamily => 'RedHat' }}

describe 'no params' do
it { should include_class('pureftpd::install') }
it { should contain_class('pureftpd::install') }
it { should contain_package('pure-ftpd').with_ensure('present') }
it { should_not contain_package('pure-ftpd-selinux').with_ensure('present') }
end

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

it { should include_class('pureftpd::install') }
it { should contain_class('pureftpd::install') }
it { should contain_package('pure-ftpd').with_ensure('present') }
it { should_not contain_package('pure-ftpd-selinux').with_ensure('present') }
end

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

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

it 'should fail' do
expect { should include_class('pureftpd::install') }.
expect { should contain_class('pureftpd::install') }.
to raise_error(Puppet::Error, /not a boolean/)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/params_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
describe 'for osfamily RedHat' do
let(:facts) {{ :osfamily => 'RedHat' }}

it { should include_class('pureftpd::params') }
it { should contain_class('pureftpd::params') }
end

describe 'unsupported osfamily' do
Expand All @@ -16,7 +16,7 @@
end

it 'should fail' do
expect { should include_class('pureftpd::params') }.
expect { should contain_class('pureftpd::params') }.
to raise_error(Puppet::Error, /not supported on Debian/)
end
end
Expand Down
28 changes: 14 additions & 14 deletions spec/classes/pureftpd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
let(:facts) { {:osfamily=> 'RedHat'} }

describe 'with no params' do
it { should include_class('pureftpd') }
it { should contain_class('pureftpd') }
it { should contain_class('pureftpd::install') }
it do
should contain_class('pureftpd::config').
Expand All @@ -19,7 +19,7 @@
describe 'with $use_selinux => true' do
let(:params) {{ :use_selinux => true }}

it { should include_class('pureftpd') }
it { should contain_class('pureftpd') }
it { should contain_class('pureftpd::install').with_use_selinux(true) }
it do
should contain_class('pureftpd::config').
Expand All @@ -34,7 +34,7 @@
describe 'with $use_selinux => false' do
let(:params) {{ :use_selinux => false }}

it { should include_class('pureftpd') }
it { should contain_class('pureftpd') }
it { should contain_class('pureftpd::install').with_use_selinux(false) }
it do
should contain_class('pureftpd::config').
Expand All @@ -51,15 +51,15 @@

it 'should fail' do
expect {
should include_class('pureftpd')
should contain_class('pureftpd')
}.to raise_error(Puppet::Error, /is not a boolean/)
end
end

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

it { should include_class('pureftpd') }
it { should contain_class('pureftpd') }
it { should contain_class('pureftpd::install') }
it do
should contain_class('pureftpd::config').
Expand All @@ -79,7 +79,7 @@
}
}}

it { should include_class('pureftpd') }
it { should contain_class('pureftpd') }
it { should contain_class('pureftpd::install') }
it do
should contain_class('pureftpd::config').
Expand All @@ -100,7 +100,7 @@

it 'should fail' do
expect {
should include_class('pureftpd')
should contain_class('pureftpd')
}.to raise_error(Puppet::Error, /is not a Hash/)
end
end
Expand All @@ -115,7 +115,7 @@
}
end

it { should include_class('pureftpd') }
it { should contain_class('pureftpd') }
it { should contain_class('pureftpd::install') }
it do
should contain_class('pureftpd::config').
Expand All @@ -139,7 +139,7 @@

it 'should fail' do
expect {
should include_class('pureftpd')
should contain_class('pureftpd')
}.to raise_error(Puppet::Error, /is not a Hash/)
end
end
Expand All @@ -154,7 +154,7 @@
}
end

it { should include_class('pureftpd') }
it { should contain_class('pureftpd') }
it { should contain_class('pureftpd::install') }
it do
should contain_class('pureftpd::config').
Expand All @@ -178,7 +178,7 @@

it 'should fail' do
expect {
should include_class('pureftpd')
should contain_class('pureftpd')
}.to raise_error(Puppet::Error, /is not a Hash/)
end
end
Expand All @@ -193,7 +193,7 @@
}
end

it { should include_class('pureftpd') }
it { should contain_class('pureftpd') }
it { should contain_class('pureftpd::install') }
it do
should contain_class('pureftpd::config').
Expand All @@ -217,7 +217,7 @@

it 'should fail' do
expect {
should include_class('pureftpd')
should contain_class('pureftpd')
}.to raise_error(Puppet::Error, /is not a Hash/)
end
end
Expand All @@ -241,7 +241,7 @@
}
end

it { should include_class('pureftpd') }
it { should contain_class('pureftpd') }
it { should contain_class('pureftpd::install') }
it do
should contain_class('pureftpd::config').
Expand Down

0 comments on commit 30bd33d

Please sign in to comment.