我想修补 sprockets-rails 中的一个错误,但是当我运行测试套件(使用 ruby-2.0.0-p0 和 ruby-head)时,出现以下错误:
/Users/btaitelb/.rvm/rubies/ruby-head/lib/ruby/2.1.0/test/unit.rb:707:in `block in _prepare_run': undefined method `size' for #<ParallelEach:0x007f823aa55e88> (NoMethodError)
from /Users/btaitelb/.rvm/rubies/ruby-head/lib/ruby/2.1.0/test/unit.rb:707:in `each'
from /Users/btaitelb/.rvm/rubies/ruby-head/lib/ruby/2.1.0/test/unit.rb:707:in `inject'
from /Users/btaitelb/.rvm/rubies/ruby-head/lib/ruby/2.1.0/test/unit.rb:707:in `_prepare_run'
from /Users/btaitelb/.rvm/rubies/ruby-head/lib/ruby/2.1.0/test/unit.rb:648:in `_run_suites'
from /Users/btaitelb/.rvm/gems/ruby-head@rails-dev/gems/minitest-4.7.1/lib/minitest/unit.rb:861:in `_run_anything'
from /Users/btaitelb/.rvm/gems/ruby-head@rails-dev/gems/minitest-4.7.1/lib/minitest/unit.rb:1068:in `run_tests'
from /Users/btaitelb/.rvm/gems/ruby-head@rails-dev/gems/minitest-4.7.1/lib/minitest/unit.rb:1055:in `block in _run'
from /Users/btaitelb/.rvm/gems/ruby-head@rails-dev/gems/minitest-4.7.1/lib/minitest/unit.rb:1054:in `each'
from /Users/btaitelb/.rvm/gems/ruby-head@rails-dev/gems/minitest-4.7.1/lib/minitest/unit.rb:1054:in `_run'
from /Users/btaitelb/.rvm/gems/ruby-head@rails-dev/gems/minitest-4.7.1/lib/minitest/unit.rb:1042:in `run'
from /Users/btaitelb/.rvm/rubies/ruby-head/lib/ruby/2.1.0/test/unit.rb:21:in `run'
from /Users/btaitelb/.rvm/rubies/ruby-head/lib/ruby/2.1.0/test/unit.rb:774:in `run'
from /Users/btaitelb/.rvm/rubies/ruby-head/lib/ruby/2.1.0/test/unit.rb:834:in `run'
from /Users/btaitelb/.rvm/rubies/ruby-head/lib/ruby/2.1.0/test/unit.rb:838:in `run'
from /Users/btaitelb/.rvm/rubies/ruby-head/bin/testrb:7:in `<main>'
我不清楚 Test::Unit 和 MiniTest 之间的关系,特别是因为我看到 test/unit.rb 引用 MiniTest::Unit
我可以通过几种方式修复这个问题,但我不确定应该归咎于哪个项目(例如我应该在哪里提交补丁):
- 在 ruby 的 test/unit.rb 中,我可以将调用替换为
size
调用 tocount
,但这仅在Test::Unit
期望成为ParallelEach
测试套件的一部分时才合适 - 在 minitest 中,我可以别名
count
为size
,如果 minitest 负责将ParallelEach
对象发送到Test::Unit
这些中的任何一个是否合适,还是这里发生了其他事情(比如命名冲突)?