newsgroups-A3naA00AKi76V6G2DxALlg@public.gmane.org
2005-Feb-08 00:00 UTC
test_process.rb => LoadError
Line 4 and following of test_process.rb reads: if defined?(RAILS_ROOT) # Temporary hack for getting functional tests in Rails running under 1.8.2 class Object #:nodoc: alias_method :require_without_load_path_reloading, :require def require(file_name) begin require_without_load_path_reloading(file_name) rescue Object => e ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } require_without_load_path_reloading(file_name) end end end end Can we change the rescue line to: rescue LoadError => e I''m not sure what this "temporary hack for getting functional tests in Rails running under 1.8.2" is supposed to do, but I''ve found that when I require files with syntax errors like test cases, they don''t actually get loaded without the above change. This makes it really confusing when I am trying to figure out why tests that should be failing appear to be passing (because their files are never loaded!). -- John Long http://wisheartdesign.com ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
Is this the right place to post stuff like this? -- John John wrote:> Line 4 and following of test_process.rb reads: > > if defined?(RAILS_ROOT) > # Temporary hack for getting functional tests in Rails running under > 1.8.2 > class Object #:nodoc: > alias_method :require_without_load_path_reloading, :require > def require(file_name) > begin > require_without_load_path_reloading(file_name) > rescue Object => e > ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if > File.directory?(dir) } > require_without_load_path_reloading(file_name) > end > end > end > end > > Can we change the rescue line to: > > rescue LoadError => e > > I''m not sure what this "temporary hack for getting functional tests in > Rails running under 1.8.2" is supposed to do, but I''ve found that > when I require files with syntax errors like test cases, they don''t > actually get loaded without the above change. This makes it really > confusing when I am trying to figure out why tests that should be > failing appear to be passing (because their files are never loaded!). > > -- > John Long > http://wisheartdesign.com > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
> Is this the right place to post stuff like this?That''s actually a really good question. Is it time for a Rails-hackers list? The Rails community has grown large enough that it might be time to diverge the Rails email list into 2 separate lists: one for Rails users and one for Rails developers. David, what do you think? -- Mando> > -- > John > > John wrote: > > Line 4 and following of test_process.rb reads: > > > > if defined?(RAILS_ROOT) > > # Temporary hack for getting functional tests in Rails running under > > 1.8.2 > > class Object #:nodoc: > > alias_method :require_without_load_path_reloading, :require > > def require(file_name) > > begin > > require_without_load_path_reloading(file_name) > > rescue Object => e > > ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if > > File.directory?(dir) } > > require_without_load_path_reloading(file_name) > > end > > end > > end > > end > > > > Can we change the rescue line to: > > > > rescue LoadError => e > > > > I''m not sure what this "temporary hack for getting functional tests in > > Rails running under 1.8.2" is supposed to do, but I''ve found that > > when I require files with syntax errors like test cases, they don''t > > actually get loaded without the above change. This makes it really > > confusing when I am trying to figure out why tests that should be > > failing appear to be passing (because their files are never loaded!). > > > > -- > > John Long > > http://wisheartdesign.com > > > > ---------------------------------------------------------------- > > This message was sent using IMP, the Internet Messaging Program. > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Seemingly Similar Threads
- assigns() method disappeared from test_process.rb
- doveadm + ldap userdb
- Odd error handling in ActionView#compile_template causes WSOD
- Some more win32-changenotify analysis
- UserEngine - rake bootstrap aborted => undefined method `synchronize_with_controllers'' for Permission:Class