如何在 Minitest 中使用块语法?

3
在Rails中,我们可以使用以下语法来使用Minitest:

test "true" do
  assert true
end

当我在我的gem中尝试使用这个语法时,我会得到一个ArgumentError(参数数量不正确)。
明确一下,我不喜欢rspec的语法(我更喜欢assert而不是describe块)。我只想写test "foo" do而不是def test_foo
我该怎么做?
我的test_helper.rb几乎是空的:
gem 'minitest'
require 'minitest/autorun'
require 'foo/bar'
1个回答

4

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接