Minitest有很多方法定义如下:
##
# :method: must_equal
# See MiniTest::Assertions#assert_equal
##
# :method: must_include
# See MiniTest::Assertions#assert_includes
##
# :method: must_match
# See MiniTest::Assertions#assert_match
##
# :method: must_output
# See MiniTest::Assertions#assert_output
这些是在Object
模块中定义的,因此它们可用于所有对象。但为什么他们不出现在任何文档中?我已经检查了Yard在rdoc.info
上生成的文档,以及rdoc
在我输入gem rdoc minitest
时生成的文档。他们也没有出现。如果它们没有出现在任何地方,我该如何引用这些?什么是:method:
应该做什么?
答案 0 :(得分:0)
这看起来像是一种记录未明确定义的方法的方法。有时你可能想要添加关于一个动态生成的方法的注释,例如,或者从另一个模块加载的方法,就像这里的情况一样。