# "interning empty string" error in test setup

**URL:** <https://www.ruby-forum.com/t/interning-empty-string-error-in-test-setup/133944>\
**Category:** Rails\
**Created:** [April 5, 2008, 10:21am UTC](https://www.ruby-forum.com/t/interning-empty-string-error-in-test-setup/133944 "2008-04-05T10:21:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [April 5, 2008, 10:21am UTC](https://www.ruby-forum.com/t/interning-empty-string-error-in-test-setup/133944/1 "2008-04-05T10:21:24Z")

</div>

On running unit tests with a setup method, I’m suddenly getting

ArgumentError: interning empty string  
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/  
active\_record/fixture  
s.rb:251:in `to_sym' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/ active_record/fixture s.rb:251:in`create\_fixtures’  
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/  
active\_record/fixture  
s.rb:250:in `map' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/ active_record/fixture s.rb:250:in`create\_fixtures’  
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/  
active\_record/base.rb  
:867:in `silence' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/ active_record/fixture s.rb:248:in`create\_fixtures’  
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/  
active\_record/fixture  
s.rb:593:in `load_fixtures' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/ active_record/fixture s.rb:547:in`setup’

From looking at fixtures.rb it looks like [""] is being passed as the  
table\_names argument to Fixtures#create\_fixtures.

Can anyone help me figure out why this started happening and how to  
fix it?

All was well and tests were passing; I then started fiddling with some  
data migrations in the test db and this error started happening.  
Incidentally part of my fiddling included accidentally rolling back  
some migrations on the development db, which I aborted for fear of  
losing some useful data; don’t know if that’s related.

Thanks,  
Andy

---

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [April 5, 2008, 9:20pm UTC](https://www.ruby-forum.com/t/interning-empty-string-error-in-test-setup/133944/2 "2008-04-05T21:20:21Z")

</div>

On Apr 5, 9:20 am, andy [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On running unit tests with a setup method, I’m suddenly getting

Could it be the case that you are calling the fixtures method with no  
arguments ? (probably not on purpose, but it’s the sort of mistake  
that’s easily done)

Fred

---

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [April 6, 2008, 4:55pm UTC](https://www.ruby-forum.com/t/interning-empty-string-error-in-test-setup/133944/3 "2008-04-06T16:55:13Z")

</div>

Thanks, Fred. Yeah, the weird thing is that I actually don’t call the  
fixtures method in any of the tests I’m running. It appears that the  
fixtures code gets called as part of the setup process.

I am finding it very hard to debug because of the way test/unit orders  
the test cases it runs. The error happens with some combinations of  
tests and not others, and I haven’t yet been able to isolate what  
exactly sets it off.

On Apr 5, 3:19 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [April 6, 2008, 5:22pm UTC](https://www.ruby-forum.com/t/interning-empty-string-error-in-test-setup/133944/4 "2008-04-06T17:22:46Z")

</div>

On 6 Apr 2008, at 15:54, andy wrote:

> Thanks, Fred. Yeah, the weird thing is that I actually don’t call the  
> fixtures method in any of the tests I’m running. It appears that the  
> fixtures code gets called as part of the setup process.

Looks like a tricky one. I’d stick a debugger breakpoint at the line  
that causes things to fall over (you can make it conditional: debugger  
if foo || bar) then walk up the stack until you find the culprit.

Fred
