Created
July 2, 2018 10:22
-
-
Save thomasleese/036a57017e8dac4d78bfb73cd025b581 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| n = I18n.available_locales.length | |
| threads = [] | |
| 1000.times do |i| | |
| loc = I18n.available_locales[i % n] | |
| threads << Thread.new do | |
| sleep rand(0.1...1.0) | |
| I18n.with_locale(loc) do | |
| sleep rand(0.1...1.0) | |
| puts "#{loc} #{I18n.locale} #{I18n.t 'document.type.announcement.one'}" | |
| raise "mismatch" unless loc == I18n.locale | |
| end | |
| end | |
| end | |
| threads.each { |t| t.join } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment