[rspec-users] How to test an app with multiple databases?

David Chelimsky dchelimsky at gmail.com
Thu Jul 8 06:34:17 EDT 2010


On Jul 8, 2010, at 2:27 AM, Juanma Cervera wrote:

> Ben Mabey wrote:
>> Spec::Runner.configure do |c|
>>  c.before(:each) do
>>    ActiveRecord::Base::establish_connection :secondary_db
>>    DatabaseCleaner.start
>>    ActiveRecord::Base::establish_connection :primary_db
>>  end
>> 
>>  c.after(:each) do
>>    ActiveRecord::Base::establish_connection :secondary_db
>>    DatabaseCleaner.clean
>>    ActiveRecord::Base::establish_connection :primary_db
>> 
>>  end
>> end
> 
> How would I translate this code for rspec 2.0.0.beta.15?
> I am using Rspec::Core::Runner but it has no configure method.

http://github.com/rspec/rspec-core/blob/master/Upgrade.markdown

HTH,
David


More information about the rspec-users mailing list