# Using Standard Integration Tests with RSpec

**URL:** <https://www.ruby-forum.com/t/using-standard-integration-tests-with-rspec/118718>\
**Category:** Rails\
**Created:** [October 30, 2007, 12:17pm UTC](https://www.ruby-forum.com/t/using-standard-integration-tests-with-rspec/118718 "2007-10-30T12:17:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dougal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@dougal](https://www.ruby-forum.com/u/dougal)\
**Post date:** [October 30, 2007, 12:17pm UTC](https://www.ruby-forum.com/t/using-standard-integration-tests-with-rspec/118718/1 "2007-10-30T12:17:09Z")

</div>

Hi there.

I am using RSpec for unit and functional testing on a project. I have  
however found the (experimental) RSpec stories to be un-intuitive in  
some situations.

The RSpec plugins seems to disable the standard Rails Tests, so how  
could I go about usng Integration tests alongside Rspec?

Thanks.

---

<div class="post-metadata">

**Author:** ![dougal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@dougal](https://www.ruby-forum.com/u/dougal)\
**Post date:** [October 30, 2007, 1:04pm UTC](https://www.ruby-forum.com/t/using-standard-integration-tests-with-rspec/118718/2 "2007-10-30T13:04:16Z")

</div>

On Oct 30, 2007 7:17 AM, Douglas S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi there.
> 
> I am using RSpec for unit and functional testing on a project. I have  
> however found the (experimental) RSpec stories to be un-intuitive in  
> some situations.
> 
> The RSpec plugins seems to disable the standard Rails Tests

This is certainly not the intent. I’ve got projects which have both  
Rails integration tests and RSpec specs and they play together  
perfectly well. You just can’t run them together in one process.

rake  
=\> runs specs and tests (in two separate processes)  
rake test  
=\> runs only tests  
rake spec  
=\> runs only specs

What is leading you to believe that it is disabled?

---

<div class="post-metadata">

**Author:** ![dougal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@dougal](https://www.ruby-forum.com/u/dougal)\
**Post date:** [October 30, 2007, 2:23pm UTC](https://www.ruby-forum.com/t/using-standard-integration-tests-with-rspec/118718/3 "2007-10-30T14:23:22Z")

</div>

Thanks for the reply David.

David C. wrote:

> This is certainly not the intent. I’ve got projects which have both  
> Rails integration tests and RSpec specs and they play together  
> perfectly well.

I thought this was the case, but a codebase I’d just taken over wasn’t  
playing nice.

> What is leading you to believe that it is disabled?

All the test tasks were running with RSpec rather than Test:unit, I  
eventually found the offending line in rspec plugin

require ‘spec/test’ if Object.const\_defined?(:Test)

Commented it out, and all is working as it should now.

---

<div class="post-metadata">

**Author:** ![dougal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@dougal](https://www.ruby-forum.com/u/dougal)\
**Post date:** [October 30, 2007, 3:34pm UTC](https://www.ruby-forum.com/t/using-standard-integration-tests-with-rspec/118718/4 "2007-10-30T15:34:27Z")

</div>

Hi again David

David C. wrote:

> I grep’d the rspec tree for this and couldn’t find it. Would you mind  
> taking a look in vendor/plugins/rspec/lib/spec/version.rb and tell me  
> the version and revision numbers?

MAJOR = 1  
MINOR = 1  
TINY = 0  
RELEASE\_CANDIDATE = nil

> Also, what line in what file?

vendor/plugins/rspec/lib/spec.rb line 25.

> I just want to make sure this isn’t a problem w/ the distribution (my  
> suspicion is it was added by the person from whom you inherited the  
> code, but I want to make sure).

Yeah, looks like one of many modifications in this system.

Cheers.

---

<div class="post-metadata">

**Author:** ![dougal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@dougal](https://www.ruby-forum.com/u/dougal)\
**Post date:** [October 30, 2007, 5:50pm UTC](https://www.ruby-forum.com/t/using-standard-integration-tests-with-rspec/118718/5 "2007-10-30T17:50:12Z")

</div>

On Oct 30, 2007 10:34 AM, Douglas S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> TINY = 0
> 
> Yeah, looks like one of many modifications in this system.

It’s possible that the plugins are from a previous trunk revision. Can  
you update to the current trunk and see if everything works OK?

---

<div class="post-metadata">

**Author:** ![dougal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@dougal](https://www.ruby-forum.com/u/dougal)\
**Post date:** [October 30, 2007, 3:18pm UTC](https://www.ruby-forum.com/t/using-standard-integration-tests-with-rspec/118718/6 "2007-10-30T15:18:46Z")

</div>

On Oct 30, 2007 9:23 AM, Douglas S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > What is leading you to believe that it is disabled?
> 
> All the test tasks were running with RSpec rather than Test:unit, I  
> eventually found the offending line in rspec plugin
> 
> require ‘spec/test’ if Object.const\_defined?(:Test)

I grep’d the rspec tree for this and couldn’t find it. Would you mind  
taking a look in vendor/plugins/rspec/lib/spec/version.rb and tell me  
the version and revision numbers?

Also, what line in what file?

I just want to make sure this isn’t a problem w/ the distribution (my  
suspicion is it was added by the person from whom you inherited the  
code, but I want to make sure).

> Commented it out, and all is working as it should now.

Great!

Thanks,  
David
