diff options
author | Paul Allen <pallen@perforce.com> | 2014-06-23 15:51:28 +0100 |
---|---|---|
committer | Paul Allen <pallen@perforce.com> | 2014-06-23 15:51:28 +0100 |
commit | 319f9fbe1954fd172da638f3ccd76e58c3ec8c7f (patch) | |
tree | 24f0bcc88c3b2ed927e7698a1b5b290f4f7e5768 /spec/unit/puppet/provider/vcsrepo | |
parent | ac4e14770fc04db02be2f48f6de675e90e3f6b29 (diff) | |
download | puppet-vcsrepo-319f9fbe1954fd172da638f3ccd76e58c3ec8c7f.tar.gz puppet-vcsrepo-319f9fbe1954fd172da638f3ccd76e58c3ec8c7f.tar.bz2 |
Added support for p4config.
- Removed p4port, p4client, p4user to keep name space clean.
- Changed notify to Puppet.debug
- Updated markdown and examples
- Updated unit tests
Diffstat (limited to 'spec/unit/puppet/provider/vcsrepo')
-rw-r--r-- | spec/unit/puppet/provider/vcsrepo/p4_spec.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/p4_spec.rb b/spec/unit/puppet/provider/vcsrepo/p4_spec.rb index 2c202f2..2bb81c8 100644 --- a/spec/unit/puppet/provider/vcsrepo/p4_spec.rb +++ b/spec/unit/puppet/provider/vcsrepo/p4_spec.rb @@ -24,9 +24,10 @@ describe Puppet::Type.type(:vcsrepo).provider(:p4) do context 'with source and revision' do it "should execute 'p4 sync' with the revision" do resource[:source] = 'something' - resource[:p4client] = 'client_ws' resource[:revision] = '1' - provider.expects(:p4).with(['client', '-o', resource.value(:p4client)]).returns({}) + ENV['P4CLIENT'] = 'client_ws1' + + provider.expects(:p4).with(['client', '-o', 'client_ws1']).returns({}) provider.expects(:p4).with(['client', '-i'], spec) provider.expects(:p4).with(['sync', resource.value(:source) + "@" + resource.value(:revision)]) provider.create @@ -36,8 +37,9 @@ describe Puppet::Type.type(:vcsrepo).provider(:p4) do context 'without revision' do it "should just execute 'p4 sync' without a revision" do resource[:source] = 'something' - resource[:p4client] = 'client_ws' - provider.expects(:p4).with(['client', '-o', resource.value(:p4client)]).returns({}) + ENV['P4CLIENT'] = 'client_ws2' + + provider.expects(:p4).with(['client', '-o', 'client_ws2']).returns({}) provider.expects(:p4).with(['client', '-i'], spec) provider.expects(:p4).with(['sync', resource.value(:source)]) provider.create @@ -55,8 +57,9 @@ describe Puppet::Type.type(:vcsrepo).provider(:p4) do describe 'destroying' do it "it should remove the directory" do - resource[:p4client] = 'test_client' - provider.expects(:p4).with(['client', '-d', '-f', resource.value(:p4client)]) + ENV['P4CLIENT'] = 'test_client' + + provider.expects(:p4).with(['client', '-d', '-f', 'test_client']) expects_rm_rf provider.destroy end |