Permalink
Browse files

Add a test-case for GH #13825

  • Loading branch information...
1 parent f5c3531 commit 0a43bf3146f0796fe23da50fa5c40e28b1398139 @guilleiguaran guilleiguaran committed Jan 24, 2014
Showing with 8 additions and 2 deletions.
  1. +8 −2 railties/test/app_rails_loader_test.rb
@@ -22,8 +22,14 @@ def expects_exec(exe)
exe = "#{script_dir}/rails"
test "is not in a Rails application if #{exe} is not found in the current or parent directories" do
- File.stubs(:exist?).with('bin/rails').returns(false)
- File.stubs(:exist?).with('script/rails').returns(false)
+ File.stubs(:file?).with('bin/rails').returns(false)
+ File.stubs(:file?).with('script/rails').returns(false)
+
+ assert !Rails::AppRailsLoader.exec_app_rails
+ end
+
+ test "is not in a Rails application if #{exe} exists but is a folder" do
+ FileUtils.mkdir_p(exe)
assert !Rails::AppRailsLoader.exec_app_rails
end

0 comments on commit 0a43bf3

Please sign in to comment.