1

我想修补 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

我可以通过几种方式修复这个问题,但我不确定应该归咎于哪个项目(例如我应该在哪里提交补丁):

  1. 在 ruby​​ 的 test/unit.rb 中,我可以将调用替换为size调用 to count,但这仅在Test::Unit期望成为ParallelEach测试套件的一部分时才合适
  2. 在 minitest 中,我可以别名countsize,如果 minitest 负责将ParallelEach对象发送到Test::Unit

这些中的任何一个是否合适,还是这里发生了其他事情(比如命名冲突)?

4

1 回答 1

0

原来这是 minitest 中的一个错误,此后已修复:https ://github.com/seattlerb/minitest/pull/275

于 2013-07-04T11:31:11.783 回答