From 33c492e0e6b04c6829b8ce4650f5e45012b770dc Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Wed, 18 Sep 2013 18:20:29 -0400 Subject: Add tests for convert_working_copy_to_bare and convert_bare_to_working_copy --- spec/unit/puppet/provider/vcsrepo/git_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'spec/unit') 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 -- cgit v1.2.3