glebm/i18n-tasks — pull request #100 by rngadam (2014-10-10 07:54:49+00:00)
Title: test numeric value as input for issue #99

Try to add a test to demonstrate and possibly fix issue #99. The test fails but I don't understand why...

```
$ rspec
.....................F[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
Translated 5 keys
+--------+----------------------+-------------------------------+
| Locale | Key | Value |
+--------+----------------------+-------------------------------+
| es | common.array_key | ["Hola.", nil, "", "Adiós."] |
| es | common.hello | Hola - %{user} O'neill! |
| es | common.hello_html | Hola - %{user} O'neill |
| es | common.nil-value-key | |
| es | common.numeric-key | 1 |
+--------+----------------------+-------------------------------+
.................................................................................

Failures:

1) Google Translation real world test #google_translate_list works with ["numeric-key", "nil-value-key", "key", "html-key.html", "array-key"]
Failure/Error: expect(translations).to eq(tests.map { |t| [t[0], t[2]] })

expected: [["numeric-key", 1], ["nil-value-key", nil], ["key", "Hola - %{user} O'neill!"], ["html-key.html", "Hola - %{user} O'neill"], ["array-key", ["Hola.", nil, "", "Adiós."]]]
got: [["numeric-key", 1], ["nil-value-key", nil], ["key", "1"], ["html-key.html", "Hola - %{user} O'neill"], ["array-key", ["Hola - zxzxzx O'neill!", nil, "Hola.", ""]]]

(compared using ==)
# ./spec/google_translate_spec.rb:25:in `block (4 levels) in '

Finished in 6.12 seconds (files took 0.34055 seconds to load)
103 examples, 1 failure

Failed examples:

rspec ./spec/google_translate_spec.rb:21 # Google Translation real world test #google_translate_list works with ["numeric-key", "nil-value-key", "key", "html-key.html", "array-key"]
```