diff options
author | tphoney <tp@puppet.com> | 2017-07-06 12:02:58 +0100 |
---|---|---|
committer | tphoney <tp@puppet.com> | 2017-07-06 12:02:58 +0100 |
commit | 085496fd19c21bf2d02b8ad871d7cab850b92b93 (patch) | |
tree | 45a6a7caecd16e9cb0fe4c40cd794507c5a24349 /spec/functions/ensure_resources_spec.rb | |
parent | d85094eb73a898361e909ed2da8fcf466f1bb750 (diff) |
(MODULES-5186) move test to correct location
Diffstat (limited to 'spec/functions/ensure_resources_spec.rb')
-rw-r--r-- | spec/functions/ensure_resources_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/functions/ensure_resources_spec.rb b/spec/functions/ensure_resources_spec.rb new file mode 100644 index 0000000..aea723e --- /dev/null +++ b/spec/functions/ensure_resources_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe 'test::ensure_resources', type: :class do + let(:params) {{ resource_type: 'user', title_hash: title_param, attributes_hash: {'ensure' => 'present'} }} + + describe 'given a title hash of multiple resources' do + + let(:title_param) { {'dan' => { 'gid' => 'mygroup', 'uid' => '600' }, 'alex' => { 'gid' => 'mygroup', 'uid' => '700'}} } + + it { is_expected.to compile } + it { is_expected.to contain_user('dan').with({ 'gid' => 'mygroup', 'uid' => '600', 'ensure' => 'present'}) } + it { is_expected.to contain_user('alex').with({ 'gid' => 'mygroup', 'uid' => '700', 'ensure' => 'present'}) } + end + + describe 'given a title hash of a single resource' do + + let(:title_param) { {'dan' => { 'gid' => 'mygroup', 'uid' => '600' }} } + + it { is_expected.to compile } + it { is_expected.to contain_user('dan').with({ 'gid' => 'mygroup', 'uid' => '600', 'ensure' => 'present'}) } + end +end |