`
chenk85
  • 浏览: 42539 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
最近访客 更多访客>>
社区版块
存档分类
最新评论

Rspec 1.1.4版的新特性

阅读更多
Rspec新版本发布了。来看看它又带来了什么。 hash_including方法,它能让开发者在Mock接受参数时不用指定全部参数,只需要指定应包含某个键值对。示例代码如下:# beforeaccount.should_receive(:deposit).with({:amount => 37.42, :date => anything()})# in 1.1.4account.should_receive(:deposit).with(hash_including(:amount => 37.42))修正了heckle支持的bug。 stub_model方法出现了,再也不用在View Spec里用mock_model之后,一个一个属性写上去了。这个方法 参考:http://blog.davidchelimsky.net/articles/2008/05/27/rspec-1-1-4
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics