【发布时间】:2015-12-17 03:30:39
【问题描述】:
为什么我需要minitest/autorun 而不是test/unit 来生成单元测试
require 'test/unit'
class Brokened
def uh_oh
"I needs fixing"
end
end
class BrokenedTest < Minitest::Test
def test_uh_of
actual = Brokened.new
assert_equal("I'm all better now", actual.uh_oh)
end
end
运行上述代码,解释器发出警告
您应该改为使用“minitest/autorun”
【问题讨论】:
-
因为
test/unit已被弃用:stackoverflow.com/a/28598052/2483313 -
@spickermann 我想知道它的原因,我知道如果我替换它代码会起作用,但我必须这样做。任何见解
标签: ruby-on-rails ruby unit-testing rubygems minitest