diff --git a/lib/vagrant/systems/linux.rb b/lib/vagrant/systems/linux.rb index 62ee4ac22..10dc7021c 100644 --- a/lib/vagrant/systems/linux.rb +++ b/lib/vagrant/systems/linux.rb @@ -69,6 +69,8 @@ module Vagrant :options => config.unison.options, :script => config.unison.script, :log_file => (config.unison.log_file % sanitized_string)) + + ssh.exec!("sudo rm -rf #{opts[:original][:guestpath]}") ssh.exec!("sudo echo \"#{crontab_entry}\" >> #{config.unison.crontab_entry_file}") ssh.exec!("crontab #{config.unison.crontab_entry_file}") end diff --git a/test/vagrant/systems/linux_test.rb b/test/vagrant/systems/linux_test.rb index 3708c695b..e10220069 100644 --- a/test/vagrant/systems/linux_test.rb +++ b/test/vagrant/systems/linux_test.rb @@ -92,6 +92,11 @@ class LinuxSystemTest < Test::Unit::TestCase @instance.create_unison(@ssh, @options) end + should "remove the original guestpath" do + @ssh.expects(:exec!).with("sudo rm -rf #{@options[:original][:guestpath]}") + @instance.create_unison(@ssh, @options) + end + should "enable the crontab file" do @ssh.expects(:exec!).with("crontab #{@mock_env.config.unison.crontab_entry_file}") @instance.create_unison(@ssh, @options)