(CONT-773) Rubocop Auto Fixes 1-5
[puppet-modules/puppetlabs-apt.git] / spec / defines / conf_spec.rb
index 1296e999f89c283ce602a3b5bde5f51a99772cd9..04551b8e5dfe326668428cc4009534d281cd8630 100644 (file)
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 require 'spec_helper'
 describe 'apt::conf', type: :define do
   let :pre_condition do
@@ -5,11 +7,18 @@ describe 'apt::conf', type: :define do
   end
   let(:facts) do
     {
-      os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
-      lsbdistid: 'Debian',
-      osfamily: 'Debian',
-      lsbdistcodename: 'wheezy',
-      puppetversion: Puppet.version,
+      os: {
+        family: 'Debian',
+        name: 'Debian',
+        release: {
+          major: '9',
+          full: '9.0',
+        },
+        distro: {
+          codename: 'stretch',
+          id: 'Debian',
+        },
+      },
     }
   end
   let :title do
@@ -33,10 +42,9 @@ describe 'apt::conf', type: :define do
 
     it {
       is_expected.to contain_file(filename).with('ensure' => 'present',
-                                                 'content'   => %r{Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;},
-                                                 'owner'     => 'root',
-                                                 'group'     => 'root',
-                                                 'mode'      => '0644')
+                                                 'content' => %r{Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;},
+                                                 'owner' => 'root',
+                                                 'group' => 'root')
     }
 
     context 'with notify_update = true (default)' do
@@ -64,7 +72,7 @@ describe 'apt::conf', type: :define do
     end
 
     it 'fails' do
-      expect { subject.call } .to raise_error(%r{pass in content})
+      is_expected.to raise_error(%r{pass in content})
     end
   end
 
@@ -82,9 +90,8 @@ describe 'apt::conf', type: :define do
 
     it {
       is_expected.to contain_file(filename).with('ensure' => 'absent',
-                                                 'owner'     => 'root',
-                                                 'group'     => 'root',
-                                                 'mode'      => '0644')
+                                                 'owner' => 'root',
+                                                 'group' => 'root')
     }
   end
 end