Skip to content
Extraits de code Groupes Projets
Valider bea33384 rédigé par Raphael Sofaer's avatar Raphael Sofaer
Parcourir les fichiers

Make sure that a MissingInterpolationArgument in the english locale is raised

parent b56838e5
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -17,7 +17,7 @@ module I18n
options.delete(:fallback)
return super(locale, nil, options.merge(:default => default)) if default
raise(I18n::MissingInterpolationError.new(locale, key, options))
raise(I18n::MissingInterpolationArgument.new(options, "key: #{key} in locale: #{locale}"))
end
end
end
......
......@@ -75,6 +75,14 @@ describe 'making sure the spec runner works' do
translation = translate('bob', :hey => "what")
translation.should == "English translation"
end
it 'MissingInterpolationError with no fallback is fatal' do
I18n.backend.stub!(:lookup).
with(:en, 'bob', nil, :hey => "what", :fallback => true).
and_return("English translation %{that_will_fail}")
lambda {
translate('bob', :hey => "what")
}.should raise_error I18n::MissingInterpolationArgument
end
end
end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter