diff options
author | Ashley Penney <ashley.penney@puppetlabs.com> | 2013-09-18 18:48:47 -0400 |
---|---|---|
committer | Ashley Penney <ashley.penney@puppetlabs.com> | 2013-09-18 18:48:47 -0400 |
commit | d163d5059b910de9d2c086a29c72e7a228090465 (patch) | |
tree | cc7e4a3eb9cf84d6e7d88c215ead120370684aed /spec/unit/puppet/provider | |
parent | 33c492e0e6b04c6829b8ce4650f5e45012b770dc (diff) | |
download | puppet-vcsrepo-d163d5059b910de9d2c086a29c72e7a228090465.tar.gz puppet-vcsrepo-d163d5059b910de9d2c086a29c72e7a228090465.tar.bz2 |
Add convert_working_copy_to_bear and convert_bare_to_working_copy tests.
Diffstat (limited to 'spec/unit/puppet/provider')
-rw-r--r-- | spec/unit/puppet/provider/vcsrepo/git_spec.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/git_spec.rb b/spec/unit/puppet/provider/vcsrepo/git_spec.rb index 33117f2..15fee53 100644 --- a/spec/unit/puppet/provider/vcsrepo/git_spec.rb +++ b/spec/unit/puppet/provider/vcsrepo/git_spec.rb @@ -343,9 +343,9 @@ describe Puppet::Type.type(:vcsrepo).provider(:git_provider) do describe 'convert_working_copy_to_bare' do it do - FileUtils.expects(:mv) - FileUtils.expects(:rm_rf) - FileUtils.expects(:mv) + FileUtils.expects(:mv).returns(true) + FileUtils.expects(:rm_rf).returns(true) + FileUtils.expects(:mv).returns(true) provider.instance_eval { convert_working_copy_to_bare } end @@ -353,11 +353,14 @@ describe Puppet::Type.type(:vcsrepo).provider(:git_provider) do describe 'convert_bare_to_working_copy' do it do - FileUtils.expects(:mv) - FileUtils.expects(:mkdir) - FileUtils.expects(:mv) + FileUtils.expects(:mv).returns(true) + FileUtils.expects(:mkdir).returns(true) + FileUtils.expects(:mv).returns(true) provider.expects(:commits_in?).returns(true) - expects_chdir + # If you forget to stub these out you lose 3 hours of rspec work. + provider.expects(:reset).with('HEAD').returns(true) + provider.expects(:git_with_identity).returns(true) + provider.expects(:update_owner_and_excludes).returns(true) provider.instance_eval { convert_bare_to_working_copy } end |