whitespace cleanup
[puppet-modules/puppetlabs-apt.git] / spec / defines / mark_spec.rb
1 # frozen_string_literal: true
2
3 require 'spec_helper'
4
5 describe 'apt::mark', type: :define do
6   let :title do
7     'my_source'
8   end
9
10   let :facts do
11     {
12       os: { family: 'Debian', name: 'Debian', release: { major: '8', full: '8.0' } },
13       lsbdistid: 'Debian',
14       lsbdistcodename: 'jessie',
15       osfamily: 'Debian',
16     }
17   end
18
19   context 'with correct seting' do
20     let :params do
21       {
22         'setting' => 'manual',
23       }
24     end
25
26     it {
27       is_expected.to contain_exec('/usr/bin/apt-mark manual my_source')
28     }
29   end
30
31   describe 'with wrong setting' do
32     let :params do
33       {
34         'setting' => 'foobar',
35       }
36     end
37
38     it do
39       is_expected.to raise_error(Puppet::PreformattedError, %r{expects a match for Enum\['auto', 'hold', 'manual', 'unhold'\], got 'foobar'})
40     end
41   end
42 end