summaryrefslogtreecommitdiff
path: root/spec/unit/puppet/provider/vcsrepo
diff options
context:
space:
mode:
authorAshley Penney <ashley.penney@puppetlabs.com>2013-09-18 18:20:29 -0400
committerAshley Penney <ashley.penney@puppetlabs.com>2013-09-18 18:20:29 -0400
commit33c492e0e6b04c6829b8ce4650f5e45012b770dc (patch)
treee9ab1e8cd548784e3d06faab5f84da9ebda3da63 /spec/unit/puppet/provider/vcsrepo
parenta3d888f1fdd0a4cbd423b8b47f546c2d1decead7 (diff)
downloadpuppet-vcsrepo-33c492e0e6b04c6829b8ce4650f5e45012b770dc.tar.gz
puppet-vcsrepo-33c492e0e6b04c6829b8ce4650f5e45012b770dc.tar.bz2
Add tests for convert_working_copy_to_bare and
convert_bare_to_working_copy
Diffstat (limited to 'spec/unit/puppet/provider/vcsrepo')
-rw-r--r--spec/unit/puppet/provider/vcsrepo/git_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/git_spec.rb b/spec/unit/puppet/provider/vcsrepo/git_spec.rb
index 1e4704f..33117f2 100644
--- a/spec/unit/puppet/provider/vcsrepo/git_spec.rb
+++ b/spec/unit/puppet/provider/vcsrepo/git_spec.rb
@@ -341,5 +341,26 @@ describe Puppet::Type.type(:vcsrepo).provider(:git_provider) do
end
end
+ describe 'convert_working_copy_to_bare' do
+ it do
+ FileUtils.expects(:mv)
+ FileUtils.expects(:rm_rf)
+ FileUtils.expects(:mv)
+
+ provider.instance_eval { convert_working_copy_to_bare }
+ end
+ end
+
+ describe 'convert_bare_to_working_copy' do
+ it do
+ FileUtils.expects(:mv)
+ FileUtils.expects(:mkdir)
+ FileUtils.expects(:mv)
+ provider.expects(:commits_in?).returns(true)
+ expects_chdir
+
+ provider.instance_eval { convert_bare_to_working_copy }
+ end
+ end
end