# Perplexing unit test issue

**URL:** <https://www.ruby-forum.com/t/perplexing-unit-test-issue/59746>\
**Category:** Rails\
**Created:** [May 5, 2006, 11:35pm UTC](https://www.ruby-forum.com/t/perplexing-unit-test-issue/59746 "2006-05-05T23:35:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deirdre\_Saoirse\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@Deirdre\_Saoirse\_M](https://www.ruby-forum.com/u/Deirdre_Saoirse_M)\
**Post date:** [May 5, 2006, 11:35pm UTC](https://www.ruby-forum.com/t/perplexing-unit-test-issue/59746/1 "2006-05-05T23:35:11Z")

</div>

Because we’re now using views, I had to upgrade to mysql 5 on a  
project using Rails 1.0. Updated my mysql gem accordingly (which  
required upgrading xcode). Ruby 1.8.2, MacOS X (10.4.6)

Worked fine several times (even before updating the mysql gem, then  
suddenly it just balked and stopped working, giving the spew below.

Have also dropped (and recreated) both the test and development  
databases, no change in error.

Did I mention that it’s perfectly happy in development and production  
when it’s not copying the structure?

$ rake test\_units --trace  
(in /Users/deirdre/Desktop/datadomain/docmanager)  
\*\* Invoke test\_units (first\_time)  
\*\* Invoke prepare\_test\_database (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute prepare\_test\_database  
\*\* Invoke clone\_structure\_to\_test (first\_time)  
\*\* Invoke db\_structure\_dump (first\_time)  
\*\* Invoke environment  
\*\* Execute db\_structure\_dump  
rake aborted!  
You have a nil object when you didn’t expect it!  
You might have expected an instance of Array.  
The error occured while evaluating nil.+  
/Users/deirdre/Desktop/datadomain/docmanager/config/…/vendor/rails/  
activerecord/lib/active\_record/connection\_adapters/mysql\_adapter.rb:  
236:in `structure_dump' /Users/deirdre/Desktop/datadomain/docmanager/config/../vendor/rails/ activerecord/lib/active_record/connection_adapters/mysql_adapter.rb: 235:in `inject’  
/Users/deirdre/Desktop/datadomain/docmanager/config/…/vendor/rails/  
activerecord/lib/active\_record/connection\_adapters/mysql\_adapter.rb:  
235:in `each' /Users/deirdre/Desktop/datadomain/docmanager/config/../vendor/rails/ activerecord/lib/active_record/connection_adapters/mysql_adapter.rb: 235:in `inject’  
/Users/deirdre/Desktop/datadomain/docmanager/config/…/vendor/rails/  
activerecord/lib/active\_record/connection\_adapters/mysql\_adapter.rb:  
235:in `structure_dump' /Users/deirdre/Desktop/datadomain/docmanager/config/../vendor/rails/ railties/lib/tasks/databases.rake:42 /Users/deirdre/Desktop/datadomain/docmanager/config/../vendor/rails/ railties/lib/tasks/databases.rake:42:in `open’  
/Users/deirdre/Desktop/datadomain/docmanager/config/…/vendor/rails/  
railties/lib/tasks/databases.rake:42  
/Users/deirdre/Desktop/datadomain/docmanager/config/…/vendor/rails/  
railties/lib/tasks/databases.rake:37:in `call' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `synchronize’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:364:in `invoke\_prerequisites’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:363:in `each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:999:in `send’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:999:in `each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:363:in `invoke\_prerequisites’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:356:in `invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `synchronize’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' /Users/deirdre/Desktop/datadomain/docmanager/config/../vendor/rails/ railties/lib/tasks/databases.rake:133 /Users/deirdre/Desktop/datadomain/docmanager/config/../vendor/rails/ railties/lib/tasks/databases.rake:132:in `call’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in  
`execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `each’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in  
`execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in  
`synchronize' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:364:in  
`invoke_prerequisites' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:363:in `each’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:999:in `send' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:999:in `each’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:363:in  
`invoke_prerequisites' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:356:in `invoke’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in  
`synchronize' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `each’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 /usr/local/bin/rake:18:in `load’  
/usr/local/bin/rake:18

–  
\_Deirdre [http://deirdre.net](http://deirdre.net)
