test/configuration/loading_test.rb in capistrano-2.15.4 vs test/configuration/loading_test.rb in capistrano-2.15.5

- old
+ new

@@ -127,6 +127,22 @@ @config.require "#{File.expand_path(File.dirname(__FILE__))}/../fixtures/custom" config2.require "#{File.expand_path(File.dirname(__FILE__))}/../fixtures/custom" assert_equal :custom, @config.ping assert_equal :custom, config2.ping end + + def test_file_in_load_path_returns_true_when_file_is_in_load_path + File.stubs(:file?).returns(false) + File.stubs(:file?).with("custom/path/for/file.rb").returns(true) + + @config.load_paths << "custom/path/for" + assert_equal true, @config.file_in_load_path?("file") + end + + def test_file_in_load_path_returns_false_when_file_is_not_in_load_path + File.stubs(:file?).returns(false) + File.stubs(:file?).with("custom/path/for/file.rb").returns(false) + + @config.load_paths << "custom/path/for" + assert_equal false, @config.file_in_load_path?("file") + end end