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
Keenan Brock a930f5ba06 Fix safe_constantize to not raise a LoadError.
### Summary

There was an issues when using `safe_constantize` on a string that has
the wrong case.

File `em.rb` defines `EM`.
`"Em".safe_constantize` causes a little confusion with the autoloader.
The autoloader finds file "em.rb",
expecting it to define `Em`, but `Em` is not defined.
The autoloader raises a `LoadError`, which is good,
But `safe_constantize` is defined to return `nil` when a class is not found.

### Before

```
"Em".safe_constantize
LoadError: Unable to autoload constant Em, \
expected rails/activesupport/test/autoloading_fixtures/em.rb to define it
```

### After

```
"Em".safe_constantize
# => nil
```
2019-01-09 14:52:46 -05:00
..
autoloading_fixtures Fix safe_constantize to not raise a LoadError. 2019-01-09 14:52:46 -05:00
cache Merge pull request #34700 from gmcgibbon/fetch_multi_key_order 2019-01-07 13:49:02 -05:00
concurrency
core_ext Tweak test name 2018-12-30 12:01:55 -05:00
dependencies Improve the logic that detects non-autoloaded constants 2018-10-28 16:34:50 +01:00
deprecation Test ActiveSupport::Deprecation.deprecate_methods 2018-12-14 11:49:54 +09:00
file_fixtures
fixtures Do nothing when the same block is included again. 2018-11-29 18:37:06 +00:00
json Enable Style/RedundantBegin cop to avoid newly adding redundant begin block 2018-12-21 06:12:42 +09:00
messages
metadata Remove redundant travel_back 2018-08-31 16:19:58 +09:00
notifications
testing assert_called_with should require args argument 2018-10-25 21:29:39 +03:00
xml_mini Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
abstract_unit.rb No need to handle if FrozenError is available 2018-12-23 13:26:20 +00:00
array_inquirer_test.rb
autoload_test.rb
benchmarkable_test.rb Change the empty block style to have space inside of the block 2018-09-25 13:19:35 -04:00
broadcast_logger_test.rb Merge pull request #34055 from Edouard-chin/ec-logger-fix 2018-10-03 16:45:53 -04:00
callback_inheritance_test.rb
callbacks_test.rb Module#{define_method,alias_method,undef_method,remove_method} become public since Ruby 2.5 2018-12-21 01:39:18 +09:00
class_cache_test.rb
clean_backtrace_test.rb Use backtrace cleaner to clean up backtrace for verbose query logs 2018-08-14 09:15:28 +10:00
clean_logger_test.rb
concern_test.rb Do nothing when the same block is included again. 2018-11-29 18:37:06 +00:00
configurable_test.rb
constantize_test_cases.rb Fix safe_constantize to not raise a LoadError. 2019-01-09 14:52:46 -05:00
current_attributes_test.rb
dependencies_test.rb Fix ruby warnings 2018-11-22 17:20:51 +09:00
dependencies_test_helpers.rb
deprecation_test.rb Enable Layout/SpaceAfterSemicolon cop to avoid newly adding odd spacing 2018-12-13 18:06:04 +09:00
descendants_tracker_test_cases.rb
descendants_tracker_with_autoloading_test.rb
descendants_tracker_without_autoloading_test.rb
digest_test.rb
encrypted_configuration_test.rb Bugfix: ActiveSupport::EncryptedConfiguration reading of comment-only encrypted files (#34014) 2018-10-05 08:06:33 +09:00
encrypted_file_test.rb
evented_file_update_checker_test.rb Do not add parent directory to file system monitoring 2018-12-18 08:09:16 +09:00
executor_test.rb Change the empty block style to have space inside of the block 2018-09-25 13:19:35 -04:00
file_update_checker_shared_tests.rb
file_update_checker_test.rb
gzip_test.rb
hash_with_indifferent_access_test.rb Make #to_options an alias for #symbolize_keys 2018-11-01 09:12:56 -07:00
i18n_test.rb
inflector_test.rb
inflector_test_cases.rb
key_generator_test.rb Remove unused requires 2018-08-17 12:51:14 +09:00
lazy_load_hooks_test.rb
log_subscriber_test.rb cpu_time and allocations are 0 when JRuby is used 2018-07-30 15:10:30 +00:00
logger_test.rb Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
message_encryptor_test.rb
message_verifier_test.rb
multibyte_chars_test.rb Add test for normalizing non-unicode string 2018-11-15 01:34:05 +09:00
multibyte_conformance_test.rb Deprecate Unicode#normalize and Chars#normalize (#34202) 2018-10-12 08:40:29 -07:00
multibyte_grapheme_break_conformance_test.rb Deprecate Unicode's #pack_graphemes and #unpack_graphemes methods 2018-10-18 14:10:30 -07:00
multibyte_normalization_conformance_test.rb Deprecate Unicode#normalize and Chars#normalize (#34202) 2018-10-12 08:40:29 -07:00
multibyte_proxy_test.rb
multibyte_test_helpers.rb Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
notifications_test.rb Extend documentation of ActiveSupport::Notifications.subscribe (#34721) 2018-12-17 17:25:55 +09:00
number_helper_i18n_test.rb
number_helper_test.rb
option_merger_test.rb
ordered_hash_test.rb
ordered_options_test.rb
parameter_filter_test.rb Implement AR#inspect using ParamterFilter. 2018-10-19 14:16:03 +09:00
reloader_test.rb Change the empty block style to have space inside of the block 2018-09-25 13:19:35 -04:00
rescuable_test.rb
safe_buffer_test.rb Handle more unsafe String methods (#33990) 2018-09-27 20:50:21 -04:00
security_utils_test.rb
share_lock_test.rb Enable Style/RedundantBegin cop to avoid newly adding redundant begin block 2018-12-21 06:12:42 +09:00
silence_logger_test.rb Don't use deprecated LoggerSilence 2018-10-04 08:23:49 +09:00
string_inquirer_test.rb
subscriber_test.rb
tagged_logging_test.rb Merge pull request #27792 from tjoyal/sandbox-tagged-logging 2018-09-11 19:33:59 -04:00
test_case_test.rb Enable Lint/UselessAssignment cop to avoid unused variable warnings (#34904) 2019-01-09 18:09:01 +09:00
time_travel_test.rb Merge pull request #34764 from kamipo/avoid_redundant_begin 2018-12-21 17:36:30 +09:00
time_zone_test.rb
time_zone_test_helpers.rb
transliterate_test.rb
xml_mini_test.rb