RSpec vs. 应该? [英] RSpec vs. Shoulda?

查看:31
本文介绍了RSpec vs. 应该?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是单元测试领域的新手;我现在只使用了大约 2 个月的单元测试.当我在 Ruby 中进行单元测试时,我目前遵循 TDD 风格并使用 Test::Unit::TestCase.我还阅读了 RSpec 以及它如何遵循 BDD 方法.我也读过关于位于两个框架之间的 Shoulda.我的问题是,我应该将时间花在 RSpec 或 Shoulda 上,还是应该坚持使用 Test::Unit::TestCase?对此主题的任何意见表示赞赏.

I am new to the unit testing scene; I have only been using unit tests for about 2 months now. When I unit test in Ruby I currently follow the TDD style and use Test::Unit::TestCase. I have also read about RSpec and how it follows the BDD methodology. I also have read about Shoulda which is a in between the two frameworks. My question is, which framework should I devote my time to RSpec or Shoulda, or should I stick with Test::Unit::TestCase? Any opinions on the subject are appreciated.

推荐答案

RSpec 有很多不错的特性,不仅仅是语法.我会推荐它而不是应该.

RSpec has a lot of nice features, more than just the syntax too. I would recommend it over Shoulda.

甚至 Thoughtbot(Shoulda 的作者)现在也在使用 RSpec.Shoulda 现在作为 RSpec 插件工作,它提供了许多有用的匹配器.

Even Thoughtbot, the authors of Shoulda, are using RSpec now. Shoulda now works as an RSpec plugin and it provides a number of useful matchers.

这篇关于RSpec vs. 应该?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆