Convert to use apt::setting instead of file resources
[puppet-modules/puppetlabs-apt.git] / spec / defines / setting_spec.rb
index 0abcead5d4a36b75b6bd45bb9afef69bcea6e82c..7b7c54efc452c4744072c901bbdbb722260532ac 100644 (file)
@@ -95,6 +95,18 @@ describe 'apt::setting' do
     it { is_expected.to contain_file('/etc/apt/apt.conf.d/100teddybear') }
   end
 
+  describe 'with base_name=puppy' do
+    let(:params) { default_params.merge({ :base_name => 'puppy' }) }
+    it { should contain_file('/etc/apt/apt.conf.d/50puppy') }
+  end
+
+  describe 'with base_name=true' do
+    let(:params) { default_params.merge({ :base_name => true }) }
+      it do
+        expect { should compile }.to raise_error(Puppet::Error, /not a string/)
+      end
+  end
+
   describe 'with ensure=absent' do
     let(:params) { default_params.merge({ :ensure => 'absent' }) }
     it { is_expected.to contain_file('/etc/apt/apt.conf.d/50teddybear').with({