为什么我应该在 Rails 中使用 RSpec 或 shoulda? [英] Why should I use RSpec or shoulda with Rails?
问题描述
我正在设置一个 rails 应用程序,我刚刚完成了一些单元测试,我的朋友说,显然夹具不再酷,人们现在正在使用 RSpec 或 shoulda.我想知道使用这些其他工具包的实际好处是什么.任何信息都表示赞赏.
I am setting up a rails app and I just finished making some unit tests and my friend said that apparently fixtures are no longer cool and people are now using RSpec or shoulda. I was wondering what the actual benefits are to use these other toolkits. Any information at all is appreciated.
-fREW
推荐答案
RSpec 和类似框架是旨在帮助行为驱动开发的工具.它们不仅仅是编写测试的一种更漂亮的方式,尽管它们确实对此有所帮助.
RSpec and similar frameworks are tooling designed to aid in Behavior Driven Development. They're not just a prettier way to write tests, though they do help with that.
这里有大量关于 BDD 的信息:http://behaviour-driven.org/和维基百科:http://en.wikipedia.org/wiki/Behavior_Driven_Development
There is plenty of information on BDD here: http://behaviour-driven.org/ And wikipedia: http://en.wikipedia.org/wiki/Behavior_Driven_Development
这里有太多好处无法一一列举,因此我建议您稍微浏览一下该网站.
There are too many benefits to list here, so I'd recommend browsing that site a little.
这篇关于为什么我应该在 Rails 中使用 RSpec 或 shoulda?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!