# Can't run specs after upgrading gems... get 0 tests, 0 assertions

**URL:** <https://www.ruby-forum.com/t/cant-run-specs-after-upgrading-gems-get-0-tests-0-assertions/176403>\
**Category:** RSpec\
**Created:** [September 30, 2009, 5:45am UTC](https://www.ruby-forum.com/t/cant-run-specs-after-upgrading-gems-get-0-tests-0-assertions/176403 "2009-09-30T05:45:49Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ignu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce73a5/32.png) [@ignu](https://www.ruby-forum.com/u/ignu)\
**Post date:** [September 30, 2009, 5:45am UTC](https://www.ruby-forum.com/t/cant-run-specs-after-upgrading-gems-get-0-tests-0-assertions/176403/1 "2009-09-30T05:45:49Z")

</div>

So after I updated all my gems, I started getting:

/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active\_support/  
dependencies.rb:105:in `const_missing': uninitialized constant Test::Unit::TestResult::TestResultFailureSupport (NameError) from /Library/Ruby/Gems/1.8/gems/test-unit-2.0.3/lib/test/unit/ testresult.rb:28 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in`gem\_original\_require’  
from /Library/Ruby/Site/1.8/rubygems/custom\_require.rb:31:in  
`require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/dependencies.rb:158:in`require’  
from /Library/Ruby/Gems/1.8/gems/rspec-1.2.8/lib/spec/interop/test.rb:  
8  
from /Library/Ruby/Site/1.8/rubygems/custom\_require.rb:31:in  
`gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in`require’  
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/  
active\_support/dependencies.rb:158:in `require' from /Library/Ruby/Gems/1.8/gems/rspec-1.2.8/lib/spec/test/unit.rb:1 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in`gem\_original\_require’  
from /Library/Ruby/Site/1.8/rubygems/custom\_require.rb:31:in  
`require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/dependencies.rb:158:in`require’  
from /Library/Ruby/Gems/1.8/gems/rspec-rails-1.2.7.1/lib/spec/  
rails.rb:13  
from /Library/Ruby/Site/1.8/rubygems/custom\_require.rb:31:in  
`gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in`require’  
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/  
active\_support/dependencies.rb:158:in `require’  
from /Users/ignu/code/surveighor/spec/spec\_helper.rb:6

Then I added

config.gem ‘test-unit’, :lib =\> ‘test/unit’

to environment.rb

Now I get:

0 tests, 0 assertions, 0 failures, 0 errors, 0 pendings, 0  
omissions, 0 notifications

And I can’t figure out why. ☹

Any ideas?

---

<div class="post-metadata">

**Author:** ![ignu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce73a5/32.png) [@ignu](https://www.ruby-forum.com/u/ignu)\
**Post date:** [September 30, 2009, 5:54am UTC](https://www.ruby-forum.com/t/cant-run-specs-after-upgrading-gems-get-0-tests-0-assertions/176403/2 "2009-09-30T05:54:01Z")

</div>

On Tue, Sep 29, 2009 at 9:37 PM, ignu [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
> 
> ```
> 
> active\_support/dependencies.rb:158:in `require' `gem\_original\_require’  
> from /Library/Ruby/Site/1.8/rubygems/custom\_require.rb:31:in  
> `require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/dependencies.rb:158:in `require’  
> from /Users/ignu/code/surveighor/spec/spec\_helper.rb:6

What versions of rails, rspec and rspec-rails were you using  
successfully before you did this upgrade? Did you run “script/generate  
rspec”? Were you seeing test/unit output before the upgrade?

---

<div class="post-metadata">

**Author:** ![ignu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce73a5/32.png) [@ignu](https://www.ruby-forum.com/u/ignu)\
**Post date:** [October 4, 2009, 12:55pm UTC](https://www.ruby-forum.com/t/cant-run-specs-after-upgrading-gems-get-0-tests-0-assertions/176403/3 "2009-10-04T12:55:46Z")

</div>

David C. wrote:

> On Tue, Sep 29, 2009 at 9:37 PM, ignu [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > ï¿½ ï¿½ ï¿½ ï¿½from /Library/Ruby/Site/1.8/rubygems/custom\_require.rb:31:in  
> > active\_support/dependencies.rb:158:in `require' `gem\_original\_require’  
> > ï¿½ ï¿½ ï¿½ ï¿½from /Library/Ruby/Site/1.8/rubygems/custom\_require.rb:31:in  
> > `require' ï¿½ ï¿½ ï¿½ ï¿½from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/dependencies.rb:158:in `require’  
> > ï¿½ ï¿½ ï¿½ ï¿½from /Users/ignu/code/surveighor/spec/spec\_helper.rb:6
> 
> What versions of rails, rspec and rspec-rails were you using  
> successfully before you did this upgrade? Did you run “script/generate  
> rspec”? Were you seeing test/unit output before the upgrade?

I have the same problem

I’m using  
Rails 2.3.4 in vendor/rails  
Rspec 1.2.8  
Rspec-Rails 1.2.7.1

I load the rspec libraries in the test.rb file  
config.gem “rspec”, :version =\> ‘1.2.8’, :lib =\> ‘spec’  
config.gem “rspec-rails”, :version =\> ‘1.2.7.1’, :lib =\> false

If I execute: “rake spec” in the console I got:  
anything  
If I execute: “RAILS\_ENV=test rake spec” in the console I got:  
Loaded suite /usr/local/bin/rake  
Started

Finished in 0.000149 seconds.

0 tests, 0 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions,  
0 notifications

I added some puts commands in my user\_spec.rb file and I’ve noticed that  
the rspec “it” blocks aren’t executed.

Any idea what happens?

Thanks

---

<div class="post-metadata">

**Author:** ![ignu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce73a5/32.png) [@ignu](https://www.ruby-forum.com/u/ignu)\
**Post date:** [October 4, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/cant-run-specs-after-upgrading-gems-get-0-tests-0-assertions/176403/4 "2009-10-04T16:20:04Z")

</div>

On Sun, Oct 4, 2009 at 5:55 AM, Paco G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > 
> 
> I load the rspec libraries in the test.rb file  
> Â config.gem “rspec”, :version =\> ‘1.2.8’, :lib =\> ‘spec’

Change this to :lib =\> false. Let us know if that fixes it.

---

<div class="post-metadata">

**Author:** ![ignu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce73a5/32.png) [@ignu](https://www.ruby-forum.com/u/ignu)\
**Post date:** [October 4, 2009, 5:58pm UTC](https://www.ruby-forum.com/t/cant-run-specs-after-upgrading-gems-get-0-tests-0-assertions/176403/5 "2009-10-04T17:58:24Z")

</div>

Yeah, I figured out it was from upgrading test/unit. Remove the 2.X  
test/unit gem and you should be fine.

---

<div class="post-metadata">

**Author:** ![ignu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce73a5/32.png) [@ignu](https://www.ruby-forum.com/u/ignu)\
**Post date:** [October 4, 2009, 10:15pm UTC](https://www.ruby-forum.com/t/cant-run-specs-after-upgrading-gems-get-0-tests-0-assertions/176403/6 "2009-10-04T22:15:05Z")

</div>

David C. wrote:

> On Sun, Oct 4, 2009 at 5:55 AM, Paco G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > > 
> > 
> > I load the rspec libraries in the test.rb file  
> > Â config.gem “rspec”, :version =\> ‘1.2.8’, :lib =\> ‘spec’
> 
> Change this to :lib =\> false. Let us know if that fixes it.

If I change to :lib =\> false I got the same text in the execution. But  
If I uninstall test-unit 2.0.3 like Len said the examples executes  
right.

Why the execution of rake spec:model task write “Could not find  
Test::Unit 2.0, ignoring” now?

Thanks David and Len

---

<div class="post-metadata">

**Author:** ![ignu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce73a5/32.png) [@ignu](https://www.ruby-forum.com/u/ignu)\
**Post date:** [October 5, 2009, 1:54am UTC](https://www.ruby-forum.com/t/cant-run-specs-after-upgrading-gems-get-0-tests-0-assertions/176403/7 "2009-10-05T01:54:13Z")

</div>

On Sun, Oct 4, 2009 at 4:15 PM, Paco G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> If I change to :lib =\> false I got the same text in the execution. But  
> If I uninstall test-unit 2.0.3 like Len said the examples executes  
> right.

There’s a pernicious known bug in RSpec that causes it to fail with  
newer versions of the test-unit gem. This has a stronger impact on  
those of us using Ruby 1.9, which doesn’t include Test::Unit at all,  
and is somewhat documented here:

[http://wiki.github.com/dchelimsky/rspec/ruby-191](http://wiki.github.com/dchelimsky/rspec/ruby-191)

I made a brief attempt at one point to figure out what broke with  
newer Test::Unit versions, but got a bit lost just setting up the  
RSpec-Dev project to pass all specs. Really troubleshooting RSpec  
internals is probably beyond me.

So I’ll be a smartass instead: David, given the broad impact and  
confusing output of the test-unit dependency problem, would it be a  
practical short-term solution to simply bundle version 1.2.3 of the  
Test::Unit gem into RSpec? And then require the bundled Test::Unit  
directly on its path instead of the gem and Ruby loadpaths?

Sure, for stock Ruby 1.8 users this would be redundant, but they  
wouldn’t really lose anything. And everyone on 1.9 or running the  
Test::Unit gem for other purposes gains reliability and a much easier  
path to getting RSpec running the first time. It’s not an ideal  
solution but it’d be quick to set up. Is there a reason why this  
wouldn’t work or shouldn’t be done?

–  
Have Fun,  
Steve E. (removed\_email\_address@domain.invalid)  
ESCAPE POD - The Science Fiction Podcast Magazine  
[http://www.escapepod.org](http://www.escapepod.org)

---

<div class="post-metadata">

**Author:** ![ignu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce73a5/32.png) [@ignu](https://www.ruby-forum.com/u/ignu)\
**Post date:** [October 6, 2009, 5:14pm UTC](https://www.ruby-forum.com/t/cant-run-specs-after-upgrading-gems-get-0-tests-0-assertions/176403/8 "2009-10-06T17:14:11Z")

</div>

On Sun, Oct 4, 2009 at 6:35 PM, Stephen E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Test::Unit gem into RSpec? And then require the bundled Test::Unit  
> directly on its path instead of the gem and Ruby loadpaths?
> 
> Sure, for stock Ruby 1.8 users this would be redundant, but they  
> wouldn’t really lose anything. And everyone on 1.9 or running the  
> Test::Unit gem for other purposes gains reliability and a much easier  
> path to getting RSpec running the first time. It’s not an ideal  
> solution but it’d be quick to set up. Is there a reason why this  
> wouldn’t work or shouldn’t be done?

I’ll give this some thought, though I’d much rather just solve the  
problem. For the 1.2.9 release I added a message. When you run specs  
w/ test/unit interop (which is implicit in rspec-rails) it senses  
whether t/u 1.2.3 is loaded - if not it raises an error explaining  
your options.

In terms of solving the problem, there are a few paths:

1. Figure out why ruby 1.9 + rubygems + activesupport is allowing two  
different versions of the same gem to be loaded.

2. Get rspec to play nice w/ test-unit-2.0.3

3. Get rspec to play nice w/ minitest.

4. Some combination of 1, 2, and 3.

This probably won’t get resolved (by me) until we release rspec-2,  
work on which has begun but it’s waiting for me to get the book off to  
print before it gets the full love and attention it needs. If anybody  
out there wants to help w/ any of the above, please fork the repo, get  
it to work, and if it works well I’ll be glad to merge it back in.

Cheers,  
David

---

<div class="post-metadata">

**Author:** ![ignu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce73a5/32.png) [@ignu](https://www.ruby-forum.com/u/ignu)\
**Post date:** [November 2, 2009, 6:49am UTC](https://www.ruby-forum.com/t/cant-run-specs-after-upgrading-gems-get-0-tests-0-assertions/176403/9 "2009-11-02T06:49:06Z")

</div>

Actually, I think this is more of a bug with test/unit.

If you are going to override inherited, be a good citizen and call  
super. 🙂  
Same with method\_missing or any other “core” method you override.

Anyways, I do have a fix. It’s to monkey-patch test/unit. How do I also  
submit the patch to test/unit?  
David C. wrote:

> On Sun, Oct 4, 2009 at 6:35 PM, Stephen E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Test::Unit gem into RSpec? ï¿½And then require the bundled Test::Unit  
> > directly on its path instead of the gem and Ruby loadpaths?
> > 
> > Sure, for stock Ruby 1.8 users this would be redundant, but they  
> > wouldn’t really lose anything. ï¿½And everyone on 1.9 or running the  
> > Test::Unit gem for other purposes gains reliability and a much easier  
> > path to getting RSpec running the first time. ï¿½It’s not an ideal  
> > solution but it’d be quick to set up. ï¿½Is there a reason why this  
> > wouldn’t work or shouldn’t be done?
> 
> I’ll give this some thought, though I’d much rather just solve the  
> problem. For the 1.2.9 release I added a message. When you run specs  
> w/ test/unit interop (which is implicit in rspec-rails) it senses  
> whether t/u 1.2.3 is loaded - if not it raises an error explaining  
> your options.
> 
> In terms of solving the problem, there are a few paths:
> 
> 1. Figure out why ruby 1.9 + rubygems + activesupport is allowing two  
> different versions of the same gem to be loaded.
> 
> 2. Get rspec to play nice w/ test-unit-2.0.3
> 
> 3. Get rspec to play nice w/ minitest.
> 
> 4. Some combination of 1, 2, and 3.
> 
> This probably won’t get resolved (by me) until we release rspec-2,  
> work on which has begun but it’s waiting for me to get the book off to  
> print before it gets the full love and attention it needs. If anybody  
> out there wants to help w/ any of the above, please fork the repo, get  
> it to work, and if it works well I’ll be glad to merge it back in.
> 
> Cheers,  
> David

---

<div class="post-metadata">

**Author:** ![ignu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce73a5/32.png) [@ignu](https://www.ruby-forum.com/u/ignu)\
**Post date:** [November 3, 2009, 12:14am UTC](https://www.ruby-forum.com/t/cant-run-specs-after-upgrading-gems-get-0-tests-0-assertions/176403/10 "2009-11-03T00:14:41Z")

</div>

On Nov 2, 2009, at 12:49 AM, Brian T. wrote:

> Actually, I think this is more of a bug with test/unit.
> 
> If you are going to override inherited, be a good citizen and call  
> super. 🙂  
> Same with method\_missing or any other “core” method you override.
> 
> Anyways, I do have a fix. It’s to monkey-patch test/unit. How do I  
> also  
> submit the patch to test/unit?

I see a tracker at [http://rubyforge.org/projects/test-unit/](http://rubyforge.org/projects/test-unit/) - give  
that a try? And thanks for doing the research.

If you don’t get a prompt response from the test/unit team, maybe we  
should include the monkey patch in RSpec for the time being. WDYT?

> > > Test::Unit gem for other purposes gains reliability and a much
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> rspec-users mailing list  
> removed\_email\_address@domain.invalid  
> [http://rubyforge.org/mailman/listinfo/rspec-users](http://rubyforge.org/mailman/listinfo/rspec-users)

Cheers,  
David

---

<div class="post-metadata">

**Author:** ![ignu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ce73a5/32.png) [@ignu](https://www.ruby-forum.com/u/ignu)\
**Post date:** [December 8, 2009, 11:12pm UTC](https://www.ruby-forum.com/t/cant-run-specs-after-upgrading-gems-get-0-tests-0-assertions/176403/11 "2009-12-08T23:12:45Z")

</div>

On Tue, Sep 29, 2009 at 9:37 PM, ignu [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
> from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/
> from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
> 
> ```
> 
> config.gem ‘test-unit’, :lib =\> ‘test/unit’  
> Any ideas?
> 
> * * *
> 
> rspec-users mailing list  
> removed\_email\_address@domain.invalid  
> [http://rubyforge.org/mailman/listinfo/rspec-users](http://rubyforge.org/mailman/listinfo/rspec-users)

I had the same problem, but it suddenly went away while updating some  
gems.  
Unfortunately, I’m not sure which one. It may have been treetop.
