Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for accessing I18n::Gettext.plural_keys hash
- Loading branch information
Tasos Latsas
authored and
Tasos Latsas
committed
Dec 24, 2016
1 parent
f76bd01
commit beb7b95
Showing
1 changed file
with
20 additions
and
0 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
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 |