diff options
author | Prathamesh Sonpatki <csonpatki@gmail.com> | 2013-04-10 08:33:05 +0530 |
---|---|---|
committer | Prathamesh Sonpatki <csonpatki@gmail.com> | 2013-04-10 20:52:33 +0530 |
commit | 22e5ab31b52a287705083ad6f3cad836ab96b619 (patch) | |
tree | 35a7ee80f77014a9ae333112497c487446b0a234 /railties/test | |
parent | 4658b0d48c6b339c504cb3273f5a1eb6960f85a4 (diff) | |
download | rails-22e5ab31b52a287705083ad6f3cad836ab96b619.tar.gz rails-22e5ab31b52a287705083ad6f3cad836ab96b619.tar.bz2 rails-22e5ab31b52a287705083ad6f3cad836ab96b619.zip |
Searching for rails executable correctly
* Current logic of finding Rails executable in parent directory is
not returning full path of executable if it is found in one of the
parent directories
* To compensate for this, we have to call exec_app_rails recursively
until the executable is found or we cant do 'chdir' anymore
* This solution finds the correct executable path from parent
directory(s) recursively
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/app_rails_loader_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/test/app_rails_loader_test.rb b/railties/test/app_rails_loader_test.rb index 63ed9eaef0..0402989705 100644 --- a/railties/test/app_rails_loader_test.rb +++ b/railties/test/app_rails_loader_test.rb @@ -17,14 +17,14 @@ class AppRailsLoaderTest < ActiveSupport::TestCase test "is not in a rails application if #{exe} exists but doesn't contain APP_PATH" do File.stubs(:exists?).with(exe).returns(true) File.stubs(:read).with(exe).returns("railties #{exe}") - assert !Rails::AppRailsLoader.find_executable + assert !Rails::AppRailsLoader.exec_app_rails end test "is in a rails application if parent directory has #{exe} containing APP_PATH" do File.stubs(:exists?).with("/foo/bar/#{exe}").returns(false) File.stubs(:exists?).with("/foo/#{exe}").returns(true) File.stubs(:read).with("/foo/#{exe}").returns('APP_PATH') - assert Rails::AppRailsLoader.find_executable_in_parent_path(Pathname.new("/foo/bar")) + assert_equal Rails::AppRailsLoader.find_executable_in_parent_path(Pathname.new("/foo/bar")), "/foo/#{exe}" end test "is not in a rails application if at the root directory and doesn't have #{exe}" do @@ -36,7 +36,7 @@ class AppRailsLoaderTest < ActiveSupport::TestCase File.stubs(:exists?).with("/foo/bar/#{exe}").returns(false) File.stubs(:exists?).with("/foo/#{exe}").returns(true) File.stubs(:read).with("/foo/#{exe}").returns('ENGINE_PATH') - assert Rails::AppRailsLoader.find_executable_in_parent_path(Pathname.new("/foo/bar")) + assert Rails::AppRailsLoader.find_executable_in_parent_path(Pathname.new("/foo/bar")), "/foo/#{exe}" end test "is in a rails engine if #{exe} exists containing ENGINE_PATH" do |