summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Allen <pallen@perforce.com>2014-06-27 17:44:27 +0100
committerPaul Allen <pallen@perforce.com>2014-06-27 17:44:27 +0100
commitb5b2dd296eb30df25ea3d4ca125ca451b162393c (patch)
tree3f226412696437f4b29f8f48c225d9314e985847
parent0435f81a3b8821a36dedc038982c3efdab90a3b1 (diff)
downloadpuppet-vcsrepo-b5b2dd296eb30df25ea3d4ca125ca451b162393c.tar.gz
puppet-vcsrepo-b5b2dd296eb30df25ea3d4ca125ca451b162393c.tar.bz2
Calculate client workspace name for test case
(The value of host will be different)
-rw-r--r--spec/unit/puppet/provider/vcsrepo/p4_spec.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/p4_spec.rb b/spec/unit/puppet/provider/vcsrepo/p4_spec.rb
index 3a4605b..2d382da 100644
--- a/spec/unit/puppet/provider/vcsrepo/p4_spec.rb
+++ b/spec/unit/puppet/provider/vcsrepo/p4_spec.rb
@@ -50,7 +50,11 @@ describe Puppet::Type.type(:vcsrepo).provider(:p4) do
it "should execute 'p4 client'" do
ENV['P4CLIENT'] = nil
- provider.expects(:p4).with(['client', '-o', "puppet-1c5e7a8e4f702e5091dfba173bc0e7c0"]).returns({})
+ path = resource.value(:path)
+ host = Facter.value('hostname')
+ default = "puppet-" + Digest::MD5.hexdigest(path + host)
+
+ provider.expects(:p4).with(['client', '-o', default]).returns({})
provider.expects(:p4).with(['client', '-i'], spec)
provider.create
end