From b0cc88dae41f9e3ebed30d68a8c9ed40e10120cb Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Fri, 12 Jun 2009 23:52:28 -0700 Subject: [PATCH] Remove dependent Resources first * Minor tweak to code that loads plugins when running specs --- spec/public/model_spec.rb | 6 +++++- spec/spec_helper.rb | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/spec/public/model_spec.rb b/spec/public/model_spec.rb index 2d2d2d8d..f5c7f679 100644 --- a/spec/public/model_spec.rb +++ b/spec/public/model_spec.rb @@ -57,8 +57,12 @@ class Article describe 'between different models' do before :all do + @other.destroy + @article.destroy + @original.destroy + # make sure the default repository is empty - @article_model.all(:repository => @repository).destroy! + @article_model.all(:repository => @repository).should be_empty # add an extra property to the alternate model DataMapper.repository(@alternate_adapter.name) do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5b1c5c0e..9762f0e5 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -12,8 +12,8 @@ require 'dm-core' -ENV['PLUGINS'].to_s.split(' ').each do |plugin| - require plugin.strip +ENV['PLUGINS'].to_s.strip.split(/\s+/).each do |plugin| + require plugin end Pathname.glob((SPEC_ROOT + '{lib,*/shared}/**/*.rb').to_s).each { |file| require file }