Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test numeric value as input for issue #99 #100

Closed
wants to merge 1 commit into from

Conversation

rngadam
Copy link

@rngadam rngadam commented Oct 10, 2014

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 - <b>%{user} O'neill</b> |
|   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 - <b>%{user} O'neill</b>"], ["array-key", ["Hola.", nil, "", "Adiós."]]]
            got: [["numeric-key", 1], ["nil-value-key", nil], ["key", "1"], ["html-key.html", "Hola - <b>%{user} O'neill</b>"], ["array-key", ["Hola - zxzxzx O'neill!", nil, "Hola.", ""]]]

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

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"]

@glebm
Copy link
Owner

glebm commented Oct 10, 2014

Could you change it to just the test?

@glebm
Copy link
Owner

glebm commented Oct 10, 2014

I've added a possible fix for this 95f5175

@glebm glebm added this to the v0.7.8 milestone Oct 16, 2014
glebm added a commit that referenced this pull request Oct 22, 2014
@glebm glebm closed this Oct 22, 2014
bartimaeus added a commit to bartimaeus/i18n-tasks that referenced this pull request Dec 1, 2014
* upstream/master: (39 commits)
  Tidy up the spec template indentation, use let(:unused_keys).
  Update README.md
  Added Gitter badge
  minor fix ignore_lines pattern
  travis: 2.1.1 -> 2.1.3
  .travis latest jruby
  Bump to 0.7.8
  Google Translate fixnum spec glebm#100
  Improve ignore_lines glebm#96 glebm#102
  initialize @key_filter glebm#101
  Lines in HAML that start with # are skipped
  ignore config: better examples
  ru copy fix
  move error message to i18n
  YARD signatures for GoogleTranslation methods
  Possible fix for glebm#99
  README: small fixes for defining custom commands
  Remove unused keys
  fix typo in gemspec [ci skip]
  Simplify commands DSL i18n
  ...

Conflicts:
	spec/google_translate_spec.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants