这是minitest,sprockets-rails还是ruby-2中的错误?

时间:2013-04-11 02:08:14

标签: sprockets testunit minitest ruby-on-rails-4 ruby-2.0

我想修补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来取代对count的调用,但只有在Test::Unit期望ParallelEach时这似乎才合适成为测试套件的一部分
  2. 在最小的情况下,我可以将count别名为size,如果minitest负责将ParallelEach个对象发送到Test::Unit
  3. ,这是有道理的

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

1 个答案:

答案 0 :(得分:0)

这被证明是最小的错误,已被修复:https://github.com/seattlerb/minitest/pull/275