1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/test/autoloading_fixtures
Jean Boussier 11e05defec Fix constantize edge case involving prepend, autoloading and name conflicts
In the following situation:

```ruby
class Bar
end

module Baz
end

class Foo
  prepend Baz
end

class Foo::Bar
end
```

Running `Inflector.constantize('Foo::Bar')` would blow up with a NameError.

What is happening is that `constatize` was written before the introduction
of prepend, and wrongly assume that `klass.ancestors.first == klass`.

So it uses `klass.ancestors.inject` without arguments, as a result
a prepended module is used in place of the actual class.
2016-12-14 14:25:43 +01:00
..
a normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
class_folder applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
html Ensure all-caps nested consts marked as autoloaded 2013-08-27 08:20:33 +01:00
load_path normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
module_folder normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
module_with_custom_const_missing/a normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
prepend Fix constantize edge case involving prepend, autoloading and name conflicts 2016-12-14 14:25:43 +01:00
application.rb
circular1.rb detect circular constant autoloading 2012-08-28 20:34:39 +02:00
circular2.rb detect circular constant autoloading 2012-08-28 20:34:39 +02:00
class_folder.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
conflict.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
counting_loader.rb
cross_site_dependency.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
d.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
em.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
loads_constant.rb This is for making sure const_missing is triggered without warnings 2010-07-26 12:51:52 -03:00
multiple_constant_file.rb
prepend.rb Fix constantize edge case involving prepend, autoloading and name conflicts 2016-12-14 14:25:43 +01:00
raises_arbitrary_exception.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
raises_name_error.rb
raises_no_method_error.rb Fix warning and incorrect test trigger 2006-11-06 23:45:39 +00:00
requires_constant.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
should_not_be_required.rb dependencies no longer trigger Kernel#autoload in remove_const [fixes #8213] 2012-11-15 04:36:36 +01:00
throws.rb Prevent void context warnings 2016-04-03 23:47:05 +01:00
typo.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00