+ it {
+ if param_hash[:purge_preferences]
+ should create_file('apt-preferences').with({
+ :ensure => 'absent',
+ :path => '/etc/apt/preferences',
+ })
+ else
+ should_not contain_file('apt-preferences')
+ end
+ }
+
+ it {
+ if param_hash[:purge_preferences_d]
+ should create_file("preferences.d").with({
+ 'path' => "/etc/apt/preferences.d",
+ 'ensure' => "directory",
+ 'owner' => "root",
+ 'group' => "root",
+ 'purge' => true,
+ 'recurse' => true,
+ })
+ else
+ should create_file("preferences.d").with({
+ 'path' => "/etc/apt/preferences.d",
+ 'ensure' => "directory",
+ 'owner' => "root",
+ 'group' => "root",
+ 'purge' => false,
+ 'recurse' => false,
+ })
+ end
+ }