From da6317880ac1803e3a1dceeb1fbb5d167901cc12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=E1=B4=80=CA=99=C9=AA=E1=B4=87=C9=B4=20W=E1=B4=87=CA=80?= =?UTF-8?q?=C9=B4=CA=9F=C9=AA?= Date: Wed, 19 Feb 2020 09:34:10 +0100 Subject: [PATCH] add support for el8 --- metadata.json | 3 ++- spec/classes/config_spec.rb | 6 ++++++ spec/types/cpan_spec_minimal.rb | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 spec/types/cpan_spec_minimal.rb diff --git a/metadata.json b/metadata.json index f6f6982..5ac57a7 100644 --- a/metadata.json +++ b/metadata.json @@ -19,7 +19,8 @@ "operatingsystemrelease": [ "5", "6", - "7" + "7", + "8" ] }, { diff --git a/spec/classes/config_spec.rb b/spec/classes/config_spec.rb index 7df14fe..f002bd5 100644 --- a/spec/classes/config_spec.rb +++ b/spec/classes/config_spec.rb @@ -45,6 +45,12 @@ ' ],', ]) end + when '8' + it { + is_expected.to contain_file('/usr/share/perl5/vendor_perl/CPAN/Config.pm').with_owner('root') + is_expected.to contain_file('/usr/share/perl5/vendor_perl/CPAN/Config.pm').with_group('root') + is_expected.to contain_file('/usr/share/perl5/vendor_perl/CPAN/Config.pm').with_mode('0644') + } end end end diff --git a/spec/types/cpan_spec_minimal.rb b/spec/types/cpan_spec_minimal.rb new file mode 100644 index 0000000..9630405 --- /dev/null +++ b/spec/types/cpan_spec_minimal.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +described_type = Puppet::Type.type(:cpan) + +describe 'cpan' do + let(:title) { 'baz' } + + describe 'force' do + it 'rejects other values (rspec)' do + expect { described_type.new(name: 'test', force: 'nope') }.to raise_error(Puppet::Error) + end + it 'rejects other values (be_valid_type)' do + expect {be_valid_type.with_set_attributes({:force => 'nope'})}.to raise_error(Puppet::Error) + end + end +end