# Radrails and RSpec

**URL:** <https://www.ruby-forum.com/t/radrails-and-rspec/73366>\
**Category:** Rails\
**Created:** [October 24, 2006, 7:10am UTC](https://www.ruby-forum.com/t/radrails-and-rspec/73366 "2006-10-24T07:10:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [October 24, 2006, 7:10am UTC](https://www.ruby-forum.com/t/radrails-and-rspec/73366/1 "2006-10-24T07:10:19Z")

</div>

Hi all,

Does anyone know how to get radrails to use RSpec specs instead of  
tests?

Cheers

---

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [October 26, 2006, 11:05am UTC](https://www.ruby-forum.com/t/radrails-and-rspec/73366/2 "2006-10-26T11:05:44Z")

</div>

Daniel,

> Does anyone know how to get radrails to use RSpec specs instead of  
> tests?

Give a try to the simply\_bdd plugin.  
[http://svn.techno-weenie.net/projects/plugins/simply\_bdd/README](http://svn.techno-weenie.net/projects/plugins/simply_bdd/README)

It makes using RSpec a lot easier: you run rspec code like normal  
tests (see the example in the README page), and it works fine with  
autotest.

Not shown in the README example is the need to use  
require ‘spec’  
to access the should\_\*\* magic.

Example:

file: test/unit/a\_user\_test.rb  
require File.dirname( **FILE** ) + ‘/…/test\_helper’  
require ‘spec’

context “A User with no name” do  
def setup  
@user = User.new  
end

```
 specify "should be invalid" do
   # assert !@user.valid? # std way
   @user.should_not_be_valid # rspec way
 end

```

end

Alain

---

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [October 26, 2006, 12:09pm UTC](https://www.ruby-forum.com/t/radrails-and-rspec/73366/3 "2006-10-26T12:09:48Z")

</div>

“It makes using RSpec a lot easier”

Its best not to confuse Rick’s plugin with RSpec - they aren’t the same  
and whilst simply bdd is neat, it doesn’t give you the full power of  
RSpec (such as the should\_ expectations).

---

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [October 26, 2006, 12:09pm UTC](https://www.ruby-forum.com/t/radrails-and-rspec/73366/4 "2006-10-26T12:09:48Z")

</div>

removed\_email\_address@domain.invalid wrote:

> “It makes using RSpec a lot easier”
> 
> Its best not to confuse Rick’s plugin with RSpec - they aren’t the same  
> and whilst simply bdd is neat, it doesn’t give you the full power of  
> RSpec (such as the should\_ expectations).

Scratch that, didn’t read the above post properly.

If you want to use RadRails though, can’t you still just use the  
console to run your tests?

---

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [October 26, 2006, 12:19pm UTC](https://www.ruby-forum.com/t/radrails-and-rspec/73366/5 "2006-10-26T12:19:48Z")

</div>

> Its best not to confuse Rick’s plugin with RSpec - they aren’t the same  
> and whilst simply bdd is neat, it doesn’t give you the full power of  
> RSpec (such as the should\_ expectations).

Read my msg again, and the example I gave: it uses a should\_\*  
expectation.

Alain

---

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [October 26, 2006, 4:02pm UTC](https://www.ruby-forum.com/t/radrails-and-rspec/73366/6 "2006-10-26T16:02:05Z")

</div>

On 10/26/06, Alain R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Its best not to confuse Rick’s plugin with RSpec - they aren’t the  
> > same  
> > and whilst simply bdd is neat, it doesn’t give you the full power of  
> > RSpec (such as the should\_ expectations).
> 
> Read my msg again, and the example I gave: it uses a should\_\* expectation.
> 
> Alain

Thanx for the insight. I’ve been using simply\_bdd for this but didn’t  
even  
think to require spec.

I’m not sure that I understand exactly what’s happening here though. If  
I  
require spec, which context method is being called? simply\_bdd or  
rpsec?  
Does it make a difference?

Luke, I can use consle for testing, but I rather use it in RadRails when  
I’m  
developing there.

I guess bdd just reasonates with me, and I’d like to use it. It seems  
that  
requiring spec in the test files would give me the best of both worlds.  
I  
can use the should\_\*\* methods and normal assert\* methods.

Thanx again for the pointers.

Cheers  
Daniel
