From a722c739945cb83f85340e4a31b717b0f4af64a0 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 17 Jun 2013 18:11:04 -0700 Subject: fixed tests --- lib/leap_cli/leapfile.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/leap_cli/leapfile.rb b/lib/leap_cli/leapfile.rb index e37cd4e..f517620 100644 --- a/lib/leap_cli/leapfile.rb +++ b/lib/leap_cli/leapfile.rb @@ -23,8 +23,8 @@ module LeapCli @vagrant_network = '10.5.5.0/24' end - def load - directory = File.expand_path(find_in_directory_tree('Leapfile')) + def load(search_directory=nil) + directory = File.expand_path(find_in_directory_tree('Leapfile', search_directory)) if directory == '/' return nil else @@ -66,8 +66,8 @@ module LeapCli end end - def find_in_directory_tree(filename) - search_dir = Dir.pwd + def find_in_directory_tree(filename, directory_tree=nil) + search_dir = directory_tree || Dir.pwd while search_dir != "/" Dir.foreach(search_dir) do |f| return search_dir if f == filename -- cgit v1.2.3