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

failing test with MRI 1.9.3 #114

Closed
terceiro opened this issue Nov 4, 2011 · 3 comments
Closed

failing test with MRI 1.9.3 #114

terceiro opened this issue Nov 4, 2011 · 3 comments

Comments

@terceiro
Copy link

terceiro commented Nov 4, 2011

This is a clone from today. All tests pass with MRI 1.8

terceiro@homer:/tmp/i18n (master)$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
terceiro@homer:/tmp/i18n (master)$ rake
/usr/bin/ruby1.9.1 -w -I"lib:lib:test" -I"/usr/lib/ruby/1.9.1" "/usr/lib/ruby/1.9.1/rake/rake_test_loader.rb" "/tmp/i18n/test/all.rb" 
/usr/lib/ruby/vendor_ruby/active_support/core_ext/bigdecimal/conversions.rb:16:in `block in included': yaml_as is deprecated, please use yaml_tag
lib/rational.rb is deprecated
/usr/lib/ruby/vendor_ruby/active_support/core_ext/hash/conversions.rb:172: warning: assigned but unused variable - child_key
/usr/lib/ruby/vendor_ruby/active_support/inflector.rb:3:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
/usr/lib/ruby/vendor_ruby/active_support/core_ext/kernel/requires.rb:12: warning: assigned but unused variable - rubygems_not_installed
/usr/lib/ruby/vendor_ruby/active_support/core_ext/kernel/requires.rb:18: warning: assigned but unused variable - gem_not_installed
/usr/lib/ruby/vendor_ruby/active_support/core_ext/uri.rb:7:in `<top (required)>': warning: URI.escape is obsolete
/usr/lib/ruby/vendor_ruby/active_support/core_ext/uri.rb:7:in `<top (required)>': warning: URI.unescape is obsolete
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:607: warning: assigned but unused variable - name
can't use KeyValue backend because: cannot load such file -- rufus/tokyo
can't use KeyValue backend because: cannot load such file -- rufus/tokyo
can't use KeyValue backend because: cannot load such file -- rufus/tokyo
/tmp/i18n/test/i18n/exceptions_test.rb:6: warning: assigned but unused variable - e
Run options: 

# Running tests:

........................................../tmp/i18n/lib/i18n/tests/localization/procs.rb:30: warning: invalid start is ignored
./tmp/i18n/lib/i18n/tests/localization/procs.rb:36: warning: invalid start is ignored
......................................................................................................./tmp/i18n/lib/i18n/tests/localization/procs.rb:30: warning: invalid start is ignored
./tmp/i18n/lib/i18n/tests/localization/procs.rb:36: warning: invalid start is ignored
..................................................................................................................................................................................................................................../tmp/i18n/lib/i18n/tests/localization/procs.rb:30: warning: invalid start is ignored
./tmp/i18n/lib/i18n/tests/localization/procs.rb:36: warning: invalid start is ignored
................................................................./tmp/i18n/test/core_ext/string/interpolate_test.rb:79: warning: too many arguments for format string
/tmp/i18n/test/core_ext/string/interpolate_test.rb:81: warning: too many arguments for format string
......../tmp/i18n/test/core_ext/string/interpolate_test.rb:68: warning: too many arguments for format string
../tmp/i18n/test/core_ext/string/interpolate_test.rb:34: warning: too many arguments for format string
/tmp/i18n/test/core_ext/string/interpolate_test.rb:35: warning: too many arguments for format string
............................................................./tmp/i18n/lib/i18n/tests/localization/procs.rb:30: warning: invalid start is ignored
./tmp/i18n/lib/i18n/tests/localization/procs.rb:36: warning: invalid start is ignored
........................................................................................................................................F......................................................................../tmp/i18n/lib/i18n/tests/localization/procs.rb:30: warning: invalid start is ignored
./tmp/i18n/lib/i18n/tests/localization/procs.rb:36: warning: invalid start is ignored
........................................................................................................./tmp/i18n/lib/i18n/tests/localization/procs.rb:30: warning: invalid start is ignored
./tmp/i18n/lib/i18n/tests/localization/procs.rb:36: warning: invalid start is ignored
......................................................................................................./tmp/i18n/lib/i18n/tests/localization/procs.rb:30: warning: invalid start is ignored
./tmp/i18n/lib/i18n/tests/localization/procs.rb:36: warning: invalid start is ignored
.........................................................................................................

Finished tests in 0.649915s, 1597.1308 tests/s, 2280.2966 assertions/s.

  1) Failure:
test_loading_an_empty_yml_file_raises_an_InvalidLocaleData_exception(I18nLoadPathTest) [/tmp/i18n/test/i18n/load_path_test.rb:16]:
I18n::InvalidLocaleData expected but nothing was raised.

1038 tests, 1482 assertions, 1 failures, 0 errors, 0 skips
rake aborted!
Command failed with status (1): [/usr/bin/ruby1.9.1 -w -I"lib:lib:test" -I"...]

Tasks: TOP => default => test
(See full trace by running task with --trace)
@voxik
Copy link
Contributor

voxik commented Jan 24, 2012

Same here.

@voxik
Copy link
Contributor

voxik commented Jan 24, 2012

I suspect this is difference between Syck and Psych.

irb(main):001:0> require 'yaml'
=> true
irb(main):002:0> YAML.load_file '/builddir/build/BUILD/rubygem-i18n-0.5.0/usr/share/gems/gems/i18n-0.5.0/test/test_data/locales/invalid/empty.yml'
=> {"en"=>nil}
irb(main):003:0> YAML::ENGINE.yamler = 'syck'
=> "syck"
irb(main):004:0> YAML.load_file '/builddir/build/BUILD/rubygem-i18n-0.5.0/usr/share/gems/gems/i18n-0.5.0/test/test_data/locales/invalid/empty.yml'
=> "en:"

@tigrish tigrish closed this as completed in 9a78917 Jul 1, 2012
@bkabrda
Copy link

bkabrda commented Jul 18, 2012

Actually, that doesn't fix the issue. If the file is left completely blank, this exception occurs:

  1) Failure:
test_loading_an_empty_yml_file_raises_an_InvalidLocaleData_exception(I18nLoadPathTest) [/builddir/build/BUILD/rubygem-i18n-0.6.0/usr/share/gems/gems/i18n-0.6.0/test/i18n/load_path_test.rb:16]:
[I18n::InvalidLocaleData] exception expected, not
Class: <TypeError>
Message: <"no implicit conversion from nil to integer">
---Backtrace---
/usr/share/ruby/psych.rb:297:in `initialize'
/usr/share/ruby/psych.rb:297:in `open'
/usr/share/ruby/psych.rb:297:in `load_file'
/builddir/build/BUILD/rubygem-i18n-0.6.0/usr/share/gems/gems/i18n-0.6.0/lib/i18n/backend/base.rb:171:in `load_yml'
/builddir/build/BUILD/rubygem-i18n-0.6.0/usr/share/gems/gems/i18n-0.6.0/lib/i18n/backend/base.rb:157:in `load_file'
/builddir/build/BUILD/rubygem-i18n-0.6.0/usr/share/gems/gems/i18n-0.6.0/lib/i18n/backend/base.rb:15:in `block in load_translations'
/builddir/build/BUILD/rubygem-i18n-0.6.0/usr/share/gems/gems/i18n-0.6.0/lib/i18n/backend/base.rb:15:in `each'
/builddir/build/BUILD/rubygem-i18n-0.6.0/usr/share/gems/gems/i18n-0.6.0/lib/i18n/backend/base.rb:15:in `load_translations'
/builddir/build/BUILD/rubygem-i18n-0.6.0/usr/share/gems/gems/i18n-0.6.0/lib/i18n/backend/simple.rb:57:in `init_translations'
/builddir/build/BUILD/rubygem-i18n-0.6.0/usr/share/gems/gems/i18n-0.6.0/lib/i18n/backend/simple.rb:71:in `lookup'
/builddir/build/BUILD/rubygem-i18n-0.6.0/usr/share/gems/gems/i18n-0.6.0/lib/i18n/backend/base.rb:26:in `translate'
/builddir/build/BUILD/rubygem-i18n-0.6.0/usr/share/gems/gems/i18n-0.6.0/lib/i18n.rb:156:in `block in translate'
/builddir/build/BUILD/rubygem-i18n-0.6.0/usr/share/gems/gems/i18n-0.6.0/lib/i18n.rb:152:in `catch'
/builddir/build/BUILD/rubygem-i18n-0.6.0/usr/share/gems/gems/i18n-0.6.0/lib/i18n.rb:152:in `translate'
/builddir/build/BUILD/rubygem-i18n-0.6.0/usr/share/gems/gems/i18n-0.6.0/test/i18n/load_path_test.rb:18:in `block (2 levels) in <class:I18nLoadPathTest>'

What works for me is leaving one blank character (space/newline) in the file, but I consider it workaround. The library should also consider that the file is left empty and rescue proper error.

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

No branches or pull requests

4 participants