以下产生错误:
require 'test/unit'
Test::Unit.setup_argv(["tests"])
$ run_tests.rb:4: undefined method `setup_argv' for Test::Unit:Module (NoMethodError)
如何让 Ruby 使用Test::Unit
类而不是Test::Unit
模块进行方法调用?
编辑红宝石 1.8.7
错误的原因是 setup_argv 在 Ruby 1.8.7 中不可用。
Test::Unit 始终是一个模块。没有课。
有关如何使用,请参阅此处的 1.8.7 文档:http:
//apidock.com/ruby/v1_8_7_330/Test/Unit