Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 5035

Show
Ignore:
Timestamp:
09/05/06 23:36:14 (2 years ago)
Author:
ulysses
Message:

Fix logic error in determining what was loaded by a given file. Closes #6039.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/CHANGELOG

    r5023 r5035  
    11*SVN* 
     2 
     3* Fix logic error in determining what was loaded by a given file. Closes #6039. [Nicholas Seckar] 
    24 
    35* Equate Kernel.const_missing with Object.const_missing. Fixes #5988. [Nicholas Seckar] 
  • trunk/activesupport/lib/active_support/dependencies.rb

    r5023 r5035  
    189189    result = load path 
    190190     
    191     newly_defined_paths = const_paths.select(&method(:qualified_const_defined?)) 
     191    newly_defined_paths = undefined_before.select(&method(:qualified_const_defined?)) 
    192192    autoloaded_constants.concat newly_defined_paths 
    193193    autoloaded_constants.uniq! 
  • trunk/activesupport/test/dependencies_test.rb

    r5023 r5035  
    429429  end 
    430430   
     431  def test_preexisting_constants_are_not_marked_as_autoloaded 
     432    with_loading 'autoloading_fixtures' do 
     433      require_dependency 'e' 
     434      assert Dependencies.autoloaded?(:E) 
     435      Dependencies.clear 
     436    end 
     437     
     438    Object.const_set :E, Class.new 
     439    with_loading 'autoloading_fixtures' do 
     440      require_dependency 'e' 
     441      assert ! Dependencies.autoloaded?(:E), "E shouldn't be marked autoloaded!" 
     442      Dependencies.clear 
     443    end 
     444     
     445  ensure 
     446    Object.send :remove_const, :E if Object.const_defined?(:E) 
     447  end 
     448   
    431449end