Not sure this is the best place, traffic seems quite low these days.
I am wondering what is the best practice to tear down classes declared
inside `describe` blocks.
```ruby # ./spec/foo_spec.rb require 'spec_helper' describe 'Foo' do class
Person < ActiveRecord::Base has_many :abilities end it 'has relations' do
expect(Person.reflections.keys).to eq %w(abilities) end end #
./spec/bar_spec.rb require 'spec_helper' describe 'Bar' do class Person <
ActiveRecord::Base has_many :children end it 'has relations' do
expect(Person.reflections.keys).to eq %w(children) end end ```
Running each individual file passes but when I run both files then it fails
(in both files with `["children", "abilities"]` in relations array).
To solve that problem, we use an `after(:all)` block to remove the constant
with `Object.send(:remove_const, 'Person').
I'd love to hear if other people use that tear down or what is the best
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to firstname.lastname@example.org.
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.