Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Ensure Model.all.destroy! is paired auto-migrations to cleanup spec s…
Browse files Browse the repository at this point in the history
…tate
  • Loading branch information
dkubb committed May 18, 2010
1 parent af68486 commit 1964977
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
16 changes: 8 additions & 8 deletions spec/lib/serialization_method_shared_spec.rb
Expand Up @@ -12,9 +12,7 @@
end

before(:each) do
Cow.all.destroy!
Planet.all.destroy!
FriendedPlanet.all.destroy!
DataMapper::Model.descendants.each { |model| model.all.destroy! }
end

it 'serializes an array of extended objects' do
Expand Down Expand Up @@ -57,9 +55,7 @@
end

before(:each) do
Cow.all.destroy!
Planet.all.destroy!
FriendedPlanet.all.destroy!
DataMapper::Model.descendants.each { |model| model.all.destroy! }
end

describe '(serializing single resources)' do
Expand Down Expand Up @@ -242,8 +238,12 @@

describe "(multiple repositories)" do
before(:all) do
QuanTum::Cat.auto_migrate!
DataMapper.repository(:alternate) { QuanTum::Cat.auto_migrate! }
[ :default, :alternate ].each do |repository_name|
DataMapper.repository(repository_name) do
QuanTum::Cat.auto_migrate!
QuanTum::Cat.all.destroy!
end
end
end

it "should use the repsoitory for the model" do
Expand Down
8 changes: 6 additions & 2 deletions spec/public/to_csv_spec.rb
Expand Up @@ -47,8 +47,12 @@

describe "multiple repositories" do
before(:all) do
QuanTum::Cat.auto_migrate!
DataMapper.repository(:alternate){ QuanTum::Cat.auto_migrate! }
[ :default, :alternate ].each do |repository_name|
DataMapper.repository(repository_name) do
QuanTum::Cat.auto_migrate!
QuanTum::Cat.all.destroy!
end
end
end

it "should use the repsoitory for the model" do
Expand Down

0 comments on commit 1964977

Please sign in to comment.