在更新到jruby-1.7.13之后,要求jruby中的自制宝石失败 [英] require self made gem in jruby fails after update to jruby-1.7.13

查看:87
本文介绍了在更新到jruby-1.7.13之后,要求jruby中的自制宝石失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用jruby-1.7.0并测试框架工作Test :: Unit :: TestCase。现在我更新了一些使我使用MiniTest :: Test进行测试的宝石,所以我也升级到jruby-1.7.13。我也有一个rake任务,它使用java * .class文件而不是ruby * .rb文件构建我的宝石。现在很多事情不再像'rake test'那样工作,或者需要从irb获取my_gem_xyz,从而得到像加载错误和ArrayIndexOutOfBoudsException之类的错误。我有rvm安装来切换红宝石。

I used jruby-1.7.0 and testing frame work Test::Unit::TestCase. Now I have updated some gems which caused me to use MiniTest::Test for testing, so I also upgraded to jruby-1.7.13. I have a rake task too which builds my gems with java *.class files instead of ruby *.rb files. Now many things dont work any more like 'rake test', or require "my_gem_xyz" from irb, getting errors like load error and ArrayIndexOutOfBoudsException. I have rvm installed to switch between rubies.

如何在自制宝石中使用* .class文件,就像以前在jruby-1.7.0下工作的一样? (如果我将* .rb文件包含在gem中,它似乎可以正常工作)

How can I use *.class files in my self made gems like it worked before under jruby-1.7.0? (If I include the *.rb files in the gem it seems to work ok)

前一段时间,我尝试使用jruby-1.7.4,但也失败了,原因(当时我仍然使用Test :: Unit :: TestCase,所以测试框架的工作不是问题)

Some time ago I tried with jruby-1.7.4 but that also failed with similar reasons (at that time I still used Test::Unit::TestCase, so the test frame work is not the problem)

有什么想法?

Frank

Frank

推荐答案

我发现了一个令人惊讶的解决方案。我用我的jruby版本1.7.0的jrubyc编译了* .rb类。这导致测试在加载错误时失败。我必须使用jrubyc 1.7.13版编译所有的ruby类,我也在那里编译宝石。

I found a surprising solution to the problem. I had compiled the *.rb classes with my jruby version 1.7.0's jrubyc. This caused the tests to fail with the load error. I had to compile all ruby classes with the jrubyc version 1.7.13 where I also build the gems.

update:


'rake test'仍然无法处理错误,例如Mocha :: ExpectationError:意外调用:...

'rake test' still does not work comming up with errors like Mocha::ExpectationError: unexpected invocation: ...

有用的是使用指定测试文件和测试名称的测试选项(也用reg.exp。),比如

what works is to use test options specifiying test file and test name (also with reg.exp.) like


rake test TEST = test / test_bla_bla.rb TESTOPTS = - name = / test_should_read / -v

rake test TEST=test/test_bla_bla.rb TESTOPTS="--name=/test_should_read/ -v"

我有这种感觉用种子参数进行随机化会导致问题。如何影响种子参数?

I have the feeling the randomization with the seed parameter causes the problem. How can I influence the seed parameter?

更新:

它看起来像是有太多的测试测试套件MiniTest无法处理这个问题。在某些情况下,我可以使用TESTOPTS开关在大约35次的时间内运行10次左右的测试。如果我使用'rake test'在我的测试库中运行所有测试,我总是会失败。这看起来像是一个bug。有没有人可以帮忙?

It looks like if there are too many tests in the test suite, MiniTest cannot handle this. In some cases I could run about 10 tests in some up to 35, using the TESTOPTS switch. I always fail if I run all tests in my test library with 'rake test'. This looks like a bug to me. Is there anybody who can help?

这篇关于在更新到jruby-1.7.13之后,要求jruby中的自制宝石失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆