class ApplicationTests::PathsTest
Public Instance Methods
assert_in_load_path(*path)
click to toggle source
# File railties/test/application/paths_test.rb, line 35 def assert_in_load_path(*path) assert $:.any? { |p| File.expand_path(p) == root(*path) }, "Load path does not include '#{root(*path)}'. They are:\n-----\n #{$:.join("\n")}\n-----" end
assert_not_in_load_path(*path)
click to toggle source
# File railties/test/application/paths_test.rb, line 39 def assert_not_in_load_path(*path) assert !$:.any? { |p| File.expand_path(p) == root(*path) }, "Load path includes '#{root(*path)}'. They are:\n-----\n #{$:.join("\n")}\n-----" end
assert_path(paths, *dir)
click to toggle source
# File railties/test/application/paths_test.rb, line 31 def assert_path(paths, *dir) assert_equal [root(*dir)], paths.expanded end
root(*path)
click to toggle source
# File railties/test/application/paths_test.rb, line 27 def root(*path) app_path(*path).to_s end
setup()
click to toggle source
# File railties/test/application/paths_test.rb, line 9 def setup build_app FileUtils.rm_rf("#{app_path}/config/environments") app_file "config/environments/development.rb", "" add_to_config <<-RUBY config.root = "#{app_path}" config.after_initialize do |app| app.config.session_store nil end RUBY require "#{app_path}/config/environment" @paths = Quails.application.config.paths end
teardown()
click to toggle source
# File railties/test/application/paths_test.rb, line 23 def teardown teardown_app end