Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5437

Extract fallback enabling logic into macro

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 8.1.0, 9.0.0, 8.0.3
    • Affects Version/s: None
    • Component/s: Tests
    • 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@mongodb.com Neil Shweky (Inactive)
            Reporter:
            shields@tablecheck.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: