summaryrefslogtreecommitdiff
path: root/spec/unit/puppet/provider
diff options
context:
space:
mode:
authorJon Fautley <jon.fautley@fil.com>2014-10-29 11:00:33 +0000
committerJon Fautley <jon.fautley@fil.com>2014-10-29 11:00:33 +0000
commit2b927e514a3d8aef5d35094e84dee3d6b47d6bf2 (patch)
tree2623269e03771c1e512c3e3d11136480b52f3bd2 /spec/unit/puppet/provider
parent9cef7c46c98153affbb3cd02e4a26afb43664e6d (diff)
downloadpuppet-vcsrepo-2b927e514a3d8aef5d35094e84dee3d6b47d6bf2.tar.gz
puppet-vcsrepo-2b927e514a3d8aef5d35094e84dee3d6b47d6bf2.tar.bz2
Add spec test for invokation as a different user
Diffstat (limited to 'spec/unit/puppet/provider')
-rw-r--r--spec/unit/puppet/provider/vcsrepo/cvs_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/cvs_spec.rb b/spec/unit/puppet/provider/vcsrepo/cvs_spec.rb
index b146d70..2e18149 100644
--- a/spec/unit/puppet/provider/vcsrepo/cvs_spec.rb
+++ b/spec/unit/puppet/provider/vcsrepo/cvs_spec.rb
@@ -27,6 +27,15 @@ describe Puppet::Type.type(:vcsrepo).provider(:cvs_provider) do
provider.create
end
+ it "should execute 'cvs checkout' as user 'muppet'" do
+ resource[:source] = ':ext:source@example.com:/foo/bar'
+ resource[:revision] = 'an-unimportant-value'
+ resource[:user] = 'muppet'
+ expects_chdir('/tmp')
+ Puppet::Util::Execution.expects(:execute).with([:cvs, '-d', resource.value(:source), 'checkout', '-r', 'an-unimportant-value', '-d', 'test', 'bar'], :uid => 'muppet', :custom_environment => {})
+ provider.create
+ end
+
it "should just execute 'cvs checkout' without a revision" do
resource[:source] = ':ext:source@example.com:/foo/bar'
resource.delete(:revision)