Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from e-travel/gettext_plural_keys_access
Access to Gettext.plural_keys
- Loading branch information
Showing
2 changed files
with
25 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'test_helper' | ||
|
||
class I18nGettextPluralKeysTest < I18n::TestCase | ||
def setup | ||
super | ||
I18n::Gettext.plural_keys[:zz] = [:value1, :value2] | ||
end | ||
|
||
test "Returns the plural keys of the given locale if present" do | ||
assert_equal I18n::Gettext.plural_keys(:zz), [:value1, :value2] | ||
end | ||
|
||
test "Returns the plural keys of :en if given locale not present" do | ||
assert_equal I18n::Gettext.plural_keys(:yy), [:one, :other] | ||
end | ||
|
||
test "Returns the whole hash with no arguments" do | ||
assert_equal I18n::Gettext.plural_keys, { :en => [:one, :other], :zz => [:value1, :value2] } | ||
end | ||
end |