From 987b3008fe126a6b04d8883a6a1f01ad0cb48579 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 8 Feb 2013 22:31:13 -0800 Subject: [PATCH] Which_test --- .../util/{file_util_test.rb => which_test.rb} | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) rename test/unit/vagrant/util/{file_util_test.rb => which_test.rb} (79%) diff --git a/test/unit/vagrant/util/file_util_test.rb b/test/unit/vagrant/util/which_test.rb similarity index 79% rename from test/unit/vagrant/util/file_util_test.rb rename to test/unit/vagrant/util/which_test.rb index 61d7897af..759f8f8a6 100644 --- a/test/unit/vagrant/util/file_util_test.rb +++ b/test/unit/vagrant/util/which_test.rb @@ -1,10 +1,9 @@ require File.expand_path("../../../base", __FILE__) -require 'vagrant/util/file_util' require 'vagrant/util/platform' +require 'vagrant/util/which' -describe Vagrant::Util::FileUtil do - +describe Vagrant::Util::Which do def tester (file_extension, test_extension, mode, &block) # create file in temp directory filename = '__vagrant_unit_test__' @@ -24,23 +23,21 @@ describe Vagrant::Util::FileUtil do it "should return a path for an executable file" do tester '.bat', '.bat', 0755 do |name| - Vagrant::Util::FileUtil.which(name).should_not be_nil + described_class.which(name).should_not be_nil end end if Vagrant::Util::Platform.windows? it "should return a path for a Windows executable file" do tester '.bat', '', 0755 do |name| - Vagrant::Util::FileUtil.which(name).should_not be_nil + described_class.which(name).should_not be_nil end end end it "should return nil for a non-executable file" do tester '.txt', '.txt', 0644 do |name| - Vagrant::Util::FileUtil.which(name).should be_nil + described_class.which(name).should be_nil end end - end -