Skip to content

Commit c5e6274

Browse files
committed
restore untested $LOAD_PATH behavior, add tests, fixes #1463
1 parent d549380 commit c5e6274

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

padrino-core/lib/padrino-core/loader.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ def require_dependencies(*paths)
169169
#
170170
def set_load_paths(*paths)
171171
load_paths.concat(paths).uniq!
172+
$LOAD_PATH.concat(paths).uniq!
172173
end
173174

174175
##

padrino-core/test/test_reloader_system.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,14 @@ def shmamily
3939
File.open(parent_file, "w") { |f| f.write(backup) }
4040
end
4141
end
42+
43+
should 'tamper with LOAD_PATH' do
44+
SystemDemo.load_paths.each do |lib_dir|
45+
assert_includes $LOAD_PATH, lib_dir
46+
end
47+
Padrino.send(:load_paths_was).each do |lib_dir|
48+
assert_includes $LOAD_PATH, lib_dir
49+
end
50+
end
4251
end
4352
end

0 commit comments

Comments
 (0)