lib/kitchen/driver/vagrant.rb in kitchen-vagrant-1.0.0 vs lib/kitchen/driver/vagrant.rb in kitchen-vagrant-1.0.1

- old
+ new

@@ -217,12 +217,11 @@ # Return true if we found the criteria to disable the cache_directory # functionality def disable_cache? # Disable for Windows not using Virtualbox if windows_host? && config[:provider] != "virtualbox" || - # Disable for FreeBSD - instance.platform.name == "freebsd" || + instance.platform.name =~ /(freebsd|macos|osx)/ || # Disable if cache_directory is set to "false" on .kitchen.yml !config[:cache_directory] return true end @@ -258,13 +257,14 @@ # Setup path for CA cert # # @api private def finalize_ca_cert! - config[:box_download_ca_cert] = File.expand_path( - config[:box_download_ca_cert], config[:kitchen_root]) unless - config[:box_download_ca_cert].nil? + unless config[:box_download_ca_cert].nil? + config[:box_download_ca_cert] = File.expand_path( + config[:box_download_ca_cert], config[:kitchen_root]) + end end # Replaces any `{{vagrant_root}}` tokens in the pre create command. # # @api private @@ -467,13 +467,13 @@ # @return [String] full local path to the directory containing the # instance's Vagrantfile # @api private def vagrant_root - @vagrant_root ||= instance.nil? ? nil : File.join( - config[:kitchen_root], %w{.kitchen kitchen-vagrant}, + root = File.join(config[:kitchen_root], %w{.kitchen kitchen-vagrant}, "kitchen-#{File.basename(config[:kitchen_root])}-#{instance.name}" ) + @vagrant_root ||= instance.nil? ? nil : root end # @param type [Symbol] either `:ssh` or `:winrm` # @return [Hash] key/value pairs resulting from parsing a # `vagrant ssh-config` or `vagrant winrm-config` local command