Skip to content

Commit

Permalink
added dsc_resource matcher examples
Browse files Browse the repository at this point in the history
  • Loading branch information
codylewandowski committed Aug 10, 2015
1 parent 4ef07a9 commit 27cb8b9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/dsc_resource/recipes/default.rb
Expand Up @@ -10,3 +10,11 @@
property :groupname, 'demo1'
property :ensure, 'present'
end

dsc_resource 'user resource' do
resource :user
property :username, 'Foobar1'
property :fullname, 'Foobar1'
property :password, 'P@assword!'
property :ensure, 'present'
end
11 changes: 11 additions & 0 deletions examples/dsc_resource/spec/default_spec.rb
Expand Up @@ -26,4 +26,15 @@
ensure: 'present'
})
end

it 'runs dsc_resource with the user resource' do
expect(chef_run).to run_dsc_resource('user resource').with(
resource: :user,
properties: {
username: 'Foobar1',
fullname: 'Foobar1',
password: 'P@assword!',
ensure: 'present'
})
end
end

0 comments on commit 27cb8b9

Please sign in to comment.