What is the community-preferred Ruby unit testing framework?

雨燕双飞 提交于 2019-12-18 11:45:30

问题


In the Java space, JUnit is predominately used and in .NET I believe nUnit is very popular. Is a community agreed upon unit testing framework for the Ruby world?

Background: I ask because I am new to Ruby and want to practice TDD at same time as I learn Ruby. So far I've only played with Test::Unit.


回答1:


You can stick to Test::Unit or you can have nice extensions to it using Shoulda or some cool contexts using Context.

On the other side, if you prefer BDD then you can safely stick to RSpec.

As for for acceptance testing use Cucumber .




回答2:


See also What’s the most commonly used unit testing framework for different types of Ruby applications? question.




回答3:


The most popular one is RSpec, although both expectations and test/unit are quite well-known.




回答4:


You may want to look into the manager gem that I have developed. It not only is a test framework, but is does documentation as well at the same time.



来源:https://stackoverflow.com/questions/1479361/what-is-the-community-preferred-ruby-unit-testing-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!