Skip to content

Commit

Permalink
Add test for accessing I18n::Gettext.plural_keys hash
Browse files Browse the repository at this point in the history
  • 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.
20 changes: 20 additions & 0 deletions test/i18n/gettext_plural_keys_test.rb
@@ -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

0 comments on commit beb7b95

Please sign in to comment.