summaryrefslogtreecommitdiff
path: root/spec/unit/puppet
diff options
context:
space:
mode:
authorDaniel DiSisto <ddisisto@gmail.com>2015-03-06 17:01:38 +1100
committerDaniel DiSisto <ddisisto@gmail.com>2015-03-06 17:01:38 +1100
commit7fdfa1b4047e134053f6df95f414cb3fc44796cd (patch)
tree71b70ebadb1e2754a7aea7f45dc8061e42cb34c9 /spec/unit/puppet
parent9a955b8746f373a1a3e47ebf67d4186b98e0094f (diff)
downloadpuppet-vcsrepo-7fdfa1b4047e134053f6df95f414cb3fc44796cd.tar.gz
puppet-vcsrepo-7fdfa1b4047e134053f6df95f414cb3fc44796cd.tar.bz2
(MODULES-1551) Add support for SVN conflict handling
Diffstat (limited to 'spec/unit/puppet')
-rw-r--r--spec/unit/puppet/provider/vcsrepo/svn_spec.rb43
1 files changed, 34 insertions, 9 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/svn_spec.rb b/spec/unit/puppet/provider/vcsrepo/svn_spec.rb
index 494da52..77f0e03 100644
--- a/spec/unit/puppet/provider/vcsrepo/svn_spec.rb
+++ b/spec/unit/puppet/provider/vcsrepo/svn_spec.rb
@@ -83,10 +83,22 @@ describe Puppet::Type.type(:vcsrepo).provider(:svn) do
before do
@revision = '30'
end
- it "should use 'svn update'" do
- expects_chdir
- provider.expects(:svn).with('--non-interactive', 'update', '-r', @revision)
- provider.revision = @revision
+ context 'with conflict' do
+ it "should use 'svn update'" do
+ resource[:conflict] = 'theirs-full'
+ expects_chdir
+ provider.expects(:svn).with('--non-interactive', 'update',
+ '-r', @revision,
+ '--accept', resource.value(:conflict))
+ provider.revision = @revision
+ end
+ end
+ context 'without conflict' do
+ it "should use 'svn update'" do
+ expects_chdir
+ provider.expects(:svn).with('--non-interactive', 'update', '-r', @revision)
+ provider.revision = @revision
+ end
end
end
@@ -94,11 +106,24 @@ describe Puppet::Type.type(:vcsrepo).provider(:svn) do
before do
@revision = '30'
end
- it "should use 'svn switch'" do
- resource[:source] = 'an-unimportant-value'
- expects_chdir
- provider.expects(:svn).with('--non-interactive', 'switch', '-r', @revision, 'an-unimportant-value')
- provider.revision = @revision
+ context 'with conflict' do
+ it "should use 'svn switch'" do
+ resource[:source] = 'an-unimportant-value'
+ resource[:conflict] = 'theirs-full'
+ expects_chdir
+ provider.expects(:svn).with('--non-interactive', 'switch',
+ '-r', @revision, 'an-unimportant-value',
+ '--accept', resource.value(:conflict))
+ provider.revision = @revision
+ end
+ end
+ context 'without conflict' do
+ it "should use 'svn switch'" do
+ resource[:source] = 'an-unimportant-value'
+ expects_chdir
+ provider.expects(:svn).with('--non-interactive', 'switch', '-r', @revision, 'an-unimportant-value')
+ provider.revision = @revision
+ end
end
end