From 87560c9edf818901a673d1add6f5bec01ac52486 Mon Sep 17 00:00:00 2001 From: Adam Cooke Date: Mon, 8 May 2017 16:40:20 +0100 Subject: [PATCH] only remove the global database if we actually made one --- spec/rails_helper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 1fd5d7a..a9e3c2b 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -36,8 +36,10 @@ RSpec.configure do |config| config.after(:suite) do # Remove the global server after the suite has finished running and then # clean the database in case it left anything lying around. - GLOBAL_SERVER.destroy - DatabaseCleaner.clean + if defined?(GLOBAL_SERVER) + GLOBAL_SERVER.destroy + DatabaseCleaner.clean + end end end