diff --git a/lib/vagrant/systems/linux.rb b/lib/vagrant/systems/linux.rb index 2da6fd11c..055ae6e19 100644 --- a/lib/vagrant/systems/linux.rb +++ b/lib/vagrant/systems/linux.rb @@ -64,7 +64,7 @@ module Vagrant def prepare_rsync(ssh) logger.info "Preparing system for rsync..." - vm.env.ssh.upload!(StringIO.new(render_rsync), config.vm.rsync_script) + vm.ssh.upload!(StringIO.new(render_rsync), config.vm.rsync_script) ssh.exec!("sudo chmod +x #{config.vm.rsync_script}") ssh.exec!("sudo rm #{config.vm.rsync_crontab_entry_file}") end @@ -107,7 +107,7 @@ module Vagrant end def render_crontab_entry(opts) - TemplateRenderer.render('crontab-entry', opts) + TemplateRenderer.render('crontab_entry', opts) end end end diff --git a/templates/crontab-entry.erb b/templates/crontab_entry.erb similarity index 100% rename from templates/crontab-entry.erb rename to templates/crontab_entry.erb diff --git a/test/vagrant/actions/vm/shared_folders_test.rb b/test/vagrant/actions/vm/shared_folders_test.rb index 581906050..f9490b5e3 100644 --- a/test/vagrant/actions/vm/shared_folders_test.rb +++ b/test/vagrant/actions/vm/shared_folders_test.rb @@ -104,7 +104,7 @@ class SharedFoldersActionTest < Test::Unit::TestCase setup do @folders = stub_shared_folders @ssh = mock("ssh") - @runner.env.ssh.stubs(:execute).yields(@ssh) + @runner.ssh.stubs(:execute).yields(@ssh) @runner.system.stubs(:mount_shared_folder) end @@ -122,7 +122,7 @@ class SharedFoldersActionTest < Test::Unit::TestCase @folders.each do |name, hostpath, guestpath, rsyncd| @runner.system.expects(:create_rsync).with(@ssh, :rsyncpath => rsyncd, :guestpath => guestpath) end - @runner.ssh.expects(:execute).yields(ssh) + @runner.ssh.expects(:execute).yields(@ssh) @action.after_boot end diff --git a/test/vagrant/systems/linux_test.rb b/test/vagrant/systems/linux_test.rb index 8c77c0eae..239a03722 100644 --- a/test/vagrant/systems/linux_test.rb +++ b/test/vagrant/systems/linux_test.rb @@ -46,12 +46,12 @@ class LinuxSystemTest < Test::Unit::TestCase context "preparing rsync" do setup do @ssh.stubs(:exec!) - @vm.env.stubs(:ssh).returns(@ssh) - @vm.env.ssh.stubs(:upload!) + @vm.stubs(:ssh).returns(@ssh) + @vm.ssh.stubs(:upload!) end should "upload the rsync template" do - @vm.env.ssh.expects(:upload!).with do |string_io, guest_path| + @vm.ssh.expects(:upload!).with do |string_io, guest_path| string_io.string =~ /#!\/bin\/sh/ && guest_path == @mock_env.config.vm.rsync_script end @@ -97,6 +97,10 @@ class LinuxSystemTest < Test::Unit::TestCase @instance.expects(:chown).with(@ssh, "foo") @instance.create_rsync(@ssh, :rsyncpath => "foo") end + + should "return provide a formatted crontab entry that runs every minute" do + assert @instance.render_crontab_entry({}).include?("* * * * *") + end end #------------------------------------------------------------------- diff --git a/vagrant.gemspec b/vagrant.gemspec index 0f05b5d6c..7d4defecb 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version= s.authors = ["Mitchell Hashimoto", "John Bender"] - s.date = %q{2010-05-18} + s.date = %q{2010-05-19} s.default_executable = %q{vagrant} s.description = %q{Vagrant is a tool for building and distributing virtualized development environments.} s.email = ["mitchell.hashimoto@gmail.com", "john.m.bender@gmail.com"] @@ -101,7 +101,7 @@ Gem::Specification.new do |s| "templates/Vagrantfile.erb", "templates/chef_server_client.erb", "templates/chef_solo_solo.erb", - "templates/crontab-entry.erb", + "templates/crontab_entry.erb", "templates/package_Vagrantfile.erb", "templates/rsync.erb", "templates/ssh_config.erb",