Skip to content
This repository was archived by the owner on Dec 28, 2023. It is now read-only.

Commit ad9affb

Browse files
Tidy up chain + fallback setup logic in tests
1 parent b102f18 commit ad9affb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/backend/fallbacks_test.rb

+5-3
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,16 @@ class Backend < I18n::Backend::Simple
125125
include I18n::Backend::Fallbacks
126126
end
127127

128+
class Chain < I18n::Backend::Chain
129+
include I18n::Backend::Fallbacks
130+
end
131+
128132
def setup
129133
super
130134
backend = Backend.new
131135
backend.store_translations(:de, :foo => 'FOO')
132136
backend.store_translations(:'pt-BR', :foo => 'Baz in :pt-BR')
133-
klass = Class.new(I18n::Backend::Chain)
134-
klass.send :include, I18n::Backend::Fallbacks
135-
I18n.backend = klass.new(I18n::Backend::Simple.new, backend)
137+
I18n.backend = Chain.new(I18n::Backend::Simple.new, backend)
136138
end
137139

138140
test "falls back from de-DE to de when there is no translation for de-DE available" do

0 commit comments

Comments
 (0)