[rspec-users] rspec and set_table_name?

Richard Sandilands richard at infoarts.info
Sat Jan 13 21:51:09 EST 2007

Hi there

I have a Value class in my Rails app; however 'values' is a reserved  
word in MySQL so in my value.rb file, I've declared set_table_name as  

However, in setting up my specs for this model, I'm hitting errors  
that seem to be resulting from rspec not seeing the set_table_name  
declaration in my model file.

For instance, rspec is throwing a MySQL error as it is attempting to  
delete records from a table named 'values' which of course does not  
exist - the table is 'vals' but the model is Value.

Is this an issue with rspec? If so, is there a way around this? I  
want to keep using rspec and am prepared to rename my class so as to  
not need the set_table_name declaration but want to be clear that  
this is the source of the problem.

Any clues would be appreciated.


More information about the rspec-users mailing list