Extract fallback enabling logic into macro

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Unknown
    • 8.1.0, 9.0.0, 8.0.3
    • Affects Version/s: None
    • Component/s: Tests
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Some files, for example, spec/mongoid/fields/localized_spec.rb contain this code:
       

      I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)

       
      This mutates the global state, and accidentally enables fallbacks for all tests which happen to run after that file. Instead, fallbacks should only be (a) enabled for the I18n fallbacks test run and (b) enabled in a manner which reverts state after run.

              Assignee:
              Neil Shweky (Inactive)
              Reporter:
              Johnny Shields
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: