Using Standard Integration Tests with RSpec

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.

On Oct 30, 2007 7:17 AM, Douglas S.
[email protected] 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?

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.

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.

On Oct 30, 2007 10:34 AM, Douglas S.
[email protected] 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?

On Oct 30, 2007 9:23 AM, Douglas S.
[email protected] 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