diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-05-01 14:03:16 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-05-01 14:03:16 +0100 |
commit | fafac666b1d9f1b73fe4330af6b3c14d57ded2cb (patch) | |
tree | 98c55238b6c8e367f9902d7f98ff812f45cf0615 | |
parent | d9954431406a06305a5d970909489d90864f62df (diff) |
Don't clean stuff if not needed.
-rw-r--r-- | test/th_mauve.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/th_mauve.rb b/test/th_mauve.rb index 99eaaed..4ec8dc5 100644 --- a/test/th_mauve.rb +++ b/test/th_mauve.rb @@ -1,5 +1,4 @@ require 'test/unit' -require 'mauve/datamapper' require 'timecop' require 'log4r' require 'pp' @@ -94,12 +93,12 @@ module Mauve end def setup_database - DataMapper::Model.raise_on_save_failure = true + DataMapper::Model.raise_on_save_failure = true if defined?(DataMapper::Model) end def teardown_database - DataObjects::Pooling.pools.each{|pool| pool.dispose} - end + DataObjects::Pooling.pools.each{|pool| pool.dispose} if defined?(DataObjects::Pooling) + end def setup_time Timecop.freeze(Time.local(2011,8,1,0,0,0,0)) @@ -110,7 +109,7 @@ module Mauve end def reset_mauve_configuration - Mauve::Configuration.current = Mauve::Configuration.new + Mauve::Configuration.current = Mauve::Configuration.new if defined?(Mauve::Configuration) end def reset_all_singletons |