# Rspec?

**URL:** <https://www.ruby-forum.com/t/rspec/99689>\
**Category:** Radiant CMS\
**Created:** [July 24, 2006, 11:47pm UTC](https://www.ruby-forum.com/t/rspec/99689 "2006-07-24T23:47:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay-levitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Post date:** [July 24, 2006, 11:47pm UTC](https://www.ruby-forum.com/t/rspec/99689/1 "2006-07-24T23:47:44Z")

</div>

Has anyone here tried modifying the behavior\_helper to work with rspec  
rather than Test::Unit? I looove me some rspec.

Jay L.

---

<div class="post-metadata">

**Author:** ![jay-levitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Post date:** [July 25, 2006, 12:12am UTC](https://www.ruby-forum.com/t/rspec/99689/2 "2006-07-25T00:12:24Z")

</div>

Jay L. wrote:

> Has anyone here tried modifying the behavior\_helper to work with rspec  
> rather than Test::Unit? I looove me some rspec.

I’m not quite sure what you mean. I’m familiar with rspec, but I’m not  
familiar with the behavior\_helper.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![jay-levitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Post date:** [July 25, 2006, 12:15am UTC](https://www.ruby-forum.com/t/rspec/99689/3 "2006-07-25T00:15:40Z")

</div>

John W. Long wrote:

> Jay L. wrote:
> 
> > Has anyone here tried modifying the behavior\_helper to work with rspec  
> > rather than Test::Unit? I looove me some rspec.
> 
> I’m not quite sure what you mean. I’m familiar with rspec, but I’m not  
> familiar with the behavior\_helper.

Ermm… sorry, I meant the behavior\_render\_test\_helper. Which, looking  
closer, isn’t actually coupled to Test::Unit, so maybe it’ll Just Work  
with rspec. Guess I’ll go play with it.

Jay

---

<div class="post-metadata">

**Author:** ![jay-levitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Post date:** [July 25, 2006, 2:15am UTC](https://www.ruby-forum.com/t/rspec/99689/4 "2006-07-25T02:15:08Z")

</div>

John W. Long wrote:

> There’s a nice class method in test\_helper.rb which makes it easy to  
> throw a bunch of methods in a module and include them with the syntax:
> 
> test\_helper :module\_name

I was just playing with that! Haven’t brought rspec into the picture,  
but meanwhile I’ve got hpricot working to test my behavior output:

[http://www.jay.fm/blog/testing-your-radiant-behaviors-with-hpricot.html](http://www.jay.fm/blog/testing-your-radiant-behaviors-with-hpricot.html)

Jay

---

<div class="post-metadata">

**Author:** ![jay-levitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Post date:** [July 25, 2006, 1:21am UTC](https://www.ruby-forum.com/t/rspec/99689/5 "2006-07-25T01:21:45Z")

</div>

Jay L. wrote:

> Ermm… sorry, I meant the behavior\_render\_test\_helper. Which, looking  
> closer, isn’t actually coupled to Test::Unit, so maybe it’ll Just Work  
> with rspec. Guess I’ll go play with it.

There’s a nice class method in test\_helper.rb which makes it easy to  
throw a bunch of methods in a module and include them with the syntax:

test\_helper :module\_name

It handles requiring the appropriate module, etc… All you have to do  
is put your module in the test/helpers directory and make it end with  
“TestHelper”. See:

[http://dev.radiantcms.org/radiant/browser/trunk/radiant/test/test\_helper.rb](http://dev.radiantcms.org/radiant/browser/trunk/radiant/test/test_helper.rb)

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![jay-levitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Post date:** [July 25, 2006, 4:08am UTC](https://www.ruby-forum.com/t/rspec/99689/6 "2006-07-25T04:08:57Z")

</div>

Jay L. wrote:

> Haven’t brought rspec into the picture, but meanwhile I’ve got hpricot  
> working to test my behavior output:
> 
> [http://www.jay.fm/blog/testing-your-radiant-behaviors-with-hpricot.html](http://www.jay.fm/blog/testing-your-radiant-behaviors-with-hpricot.html)

Nice! Keep us posted.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)
