summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorTP Honey <tphoney@users.noreply.github.com>2015-03-30 10:36:42 +0100
committerTP Honey <tphoney@users.noreply.github.com>2015-03-30 10:36:42 +0100
commit3d4547646d49295c91bb002fa885e187c2d89feb (patch)
tree922b733d6dcd048e6069bc4bbf05a64606fd8c14 /spec/unit
parent74e415866ef2d39ed1568dd43b6e8596590dedaf (diff)
parent7fdfa1b4047e134053f6df95f414cb3fc44796cd (diff)
Merge pull request #220 from ddisisto/1.2.x_add_svn_accept
Add support for 'conflict' parameter to populate svn --accept arg
Diffstat (limited to 'spec/unit')
-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