Skip to content

Commit

Permalink
restore untested $LOAD_PATH behavior, add tests, fixes #1463
Browse files Browse the repository at this point in the history
  • Loading branch information
ujifgc committed Oct 17, 2013
1 parent d549380 commit c5e6274
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions padrino-core/lib/padrino-core/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def require_dependencies(*paths)
#
def set_load_paths(*paths)
load_paths.concat(paths).uniq!
$LOAD_PATH.concat(paths).uniq!
end

##
Expand Down
9 changes: 9 additions & 0 deletions padrino-core/test/test_reloader_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,14 @@ def shmamily
File.open(parent_file, "w") { |f| f.write(backup) }
end
end

should 'tamper with LOAD_PATH' do
SystemDemo.load_paths.each do |lib_dir|
assert_includes $LOAD_PATH, lib_dir
end
Padrino.send(:load_paths_was).each do |lib_dir|
assert_includes $LOAD_PATH, lib_dir
end
end
end
end

0 comments on commit c5e6274

Please sign in to comment.