headius/thread_safe

thread_safe 0.1.0 test fail with ruby 1.8

graaff opened this issue · 5 comments

With ruby 1.8.7 (2012-06-29 patchlevel 370) [x86_64-linux] I'm getting the following test failures:

  1) Error:
test_concurrency(TestArray):
NameError: uninitialized constant ThreadSafe::Array
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing'
    /var/tmp/portage/dev-ruby/thread_safe-0.1.0/work/ruby18/thread_safe-0.1.0/test/test_array.rb:6:in `test_concurrency'

  2) Failure:
test_updates_dont_block_reads(TestCache)
    [/var/tmp/portage/dev-ruby/thread_safe-0.1.0/work/ruby18/thread_safe-0.1.0/test/test_cache.rb:285:in `test_updates_dont_block_reads'
     /var/tmp/portage/dev-ruby/thread_safe-0.1.0/work/ruby18/thread_safe-0.1.0/test/test_cache.rb:285:in `map'
     /var/tmp/portage/dev-ruby/thread_safe-0.1.0/work/ruby18/thread_safe-0.1.0/test/test_cache.rb:285:in `test_updates_dont_block_reads'
     /var/tmp/portage/dev-ruby/thread_safe-0.1.0/work/ruby18/thread_safe-0.1.0/test/test_cache.rb:247:in `each'
     /var/tmp/portage/dev-ruby/thread_safe-0.1.0/work/ruby18/thread_safe-0.1.0/test/test_cache.rb:247:in `test_updates_dont_block_reads']:
<nil> is not true.

  3) Error:
test_concurrency(TestHash):
NameError: uninitialized constant ThreadSafe::Hash
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing'
    /var/tmp/portage/dev-ruby/thread_safe-0.1.0/work/ruby18/thread_safe-0.1.0/test/test_hash.rb:6:in `test_concurrency'

66 tests, 1502 assertions, 1 failures, 2 errors

The documentation makes no mention of supported ruby versions, so I'm not sure if ruby 1.8 is supposed to work, but given that atomic still supports it I assumed thread_safe would be also.

It seems I've been mistaken that RUBY_ENGINE constant is "ruby" on 1.8 (it is so on mine 1.8 REE).

Here's what RUBY_ENGINE is for the various ruby implementations we support in Gentoo. I don't think we tinker with those on our side. /usr/bin name first, RUBY_ENGINE second:

ruby18: -e:1: uninitialized constant RUBY_ENGINE (NameError)
rubyee18: ruby
ruby19: ruby
jruby: jruby
rbx: rbx

I’m seeing this same issue. Please merge #7 or similar.

I believe this can be closed now that #7 has been merged.

Fixed by #7.