RSpec中是否有类似于shared_examples的插件/扩展用于测试::单元测试?
发布于 2013-01-25 01:27:33
Ruby测试只是Ruby类,所以您可以使用与任何其他Test::Unit类相同的代码重用方法。
要编写共享示例,可以使用模块。
module SharedExamplesForAThing
def test_a_thing_does_something
...
end
end
class ThingTest < Test::Unit::TestCase
include SharedExamplesForAThing
endhttps://stackoverflow.com/questions/14507011
复制相似问题