diff --git a/lib/vagrant/actions/box/download.rb b/lib/vagrant/actions/box/download.rb index 81e932e8e..aedf53791 100644 --- a/lib/vagrant/actions/box/download.rb +++ b/lib/vagrant/actions/box/download.rb @@ -57,7 +57,7 @@ module Vagrant end end - def file_temp_path + def file_temp_path File.join(@runner.env.tmp_path, BASENAME + Time.now.to_i.to_s) end diff --git a/test/vagrant/actions/box/download_test.rb b/test/vagrant/actions/box/download_test.rb index 01ad99a55..bb331eed6 100644 --- a/test/vagrant/actions/box/download_test.rb +++ b/test/vagrant/actions/box/download_test.rb @@ -81,9 +81,9 @@ class DownloadBoxActionTest < Test::Unit::TestCase context "tempfile" do should "create a tempfile in the vagrant tmp directory" do - File.expects(:open).with { |name, bitmask| + File.expects(:open).with { |name, bitmask| name =~ /#{Vagrant::Actions::Box::Download::BASENAME}/ && name =~ /#{@runner.env.tmp_path}/ - }.once + }.once @action.with_tempfile end