|
10 | 10 | is_expected.to run.with_params(1,2,3).and_raise_error(Puppet::ParseError)
|
11 | 11 | }
|
12 | 12 |
|
| 13 | + context 'given an empty catalog' do |
| 14 | + describe 'after running ensure_resource("user", "username1", {})' do |
| 15 | + before { subject.call(['User', 'username1', {}]) } |
| 16 | + |
| 17 | + # this lambda is required due to strangeness within rspec-puppet's expectation handling |
| 18 | + it { expect(lambda { catalogue }).to contain_user('username1').without_ensure } |
| 19 | + end |
| 20 | + |
| 21 | + describe 'after running ensure_resource("user", "username1", { gid => undef })' do |
| 22 | + before { subject.call(['User', 'username1', { 'gid' => :undef }]) } |
| 23 | + |
| 24 | + # this lambda is required due to strangeness within rspec-puppet's expectation handling |
| 25 | + it { expect(lambda { catalogue }).to contain_user('username1').without_ensure } |
| 26 | + it { expect(lambda { catalogue }).to contain_user('username1').without_gid } |
| 27 | + end |
| 28 | + |
| 29 | + describe 'after running ensure_resource("user", "username1", { ensure => present, gid => undef })' do |
| 30 | + before { subject.call(['User', 'username1', { 'ensure' => 'present', 'gid' => :undef }]) } |
| 31 | + |
| 32 | + # this lambda is required due to strangeness within rspec-puppet's expectation handling |
| 33 | + it { expect(lambda { catalogue }).to contain_user('username1').with_ensure('present') } |
| 34 | + it { expect(lambda { catalogue }).to contain_user('username1').without_gid } |
| 35 | + end |
| 36 | + |
| 37 | + end |
| 38 | + |
13 | 39 | context 'given a catalog with "user { username1: ensure => present }"' do
|
14 | 40 | let(:pre_condition) { 'user { username1: ensure => present }' }
|
15 | 41 |
|
|
28 | 54 | it { expect(lambda { catalogue }).to contain_user('username2').without_ensure }
|
29 | 55 | end
|
30 | 56 |
|
31 |
| - describe 'after running ensure_resource("user", "username1", { "gid" => undef })' do |
32 |
| - before { subject.call(['User', 'username1', { "gid" => :undef }]) } |
| 57 | + describe 'after running ensure_resource("user", "username1", { gid => undef })' do |
| 58 | + before { subject.call(['User', 'username1', { 'gid' => :undef }]) } |
33 | 59 |
|
34 | 60 | # this lambda is required due to strangeness within rspec-puppet's expectation handling
|
35 | 61 | it { expect(lambda { catalogue }).to contain_user('username1').with_ensure('present') }
|
|
0 commit comments