---
title: "Rspec 1.1.4版的新特性"
author: "chenk85"
date: "2008-05-29T09:45:16Z"
tags: []
slug: "rspec-1-1-4"
draft: false
lastmod: "2008-05-29T09:45:16Z"
id: 209268
url: "https://chenk85.iteye.com/blog/209268"
---

Rspec新版本发布了。来看看它又带来了什么。 hash\_including方法，它能让开发者在Mock接受参数时不用指定全部参数，只需要指定应包含某个键值对。示例代码如下：# beforeaccount.should\_receive(:deposit).with({:amount =&gt; 37.42, :date =&gt; anything()})# in 1.1.4account.should\_receive(:deposit).with(hash\_including(:amount =&gt; 37.42))修正了heckle支持的bug。 stub\_model方法出现了，再也不用在View Spec里用mock\_model之后，一个一个属性写上去了。这个方法 参考：http://blog.davidchelimsky.net/articles/2008/05/27/rspec-1-1-4