From ed0e43bd27930c81a7d52e2de7009233097668fd Mon Sep 17 00:00:00 2001 From: Stephen Date: Mon, 1 Apr 2024 10:42:52 +1000 Subject: [PATCH] add db reset function reset_beef_db --- spec/spec_helper.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5e96ace2b..d9b2d8576 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -100,6 +100,15 @@ RSpec.configure do |config| ######################################## +def reset_beef_db + begin + db_file = BeEF::Core::Configuration.instance.get('beef.database.file') + File.delete(db_file) if File.exist?(db_file) + rescue => e + print_error("Could not remove '#{db_file}' database file: #{e.message}") + end +end + require 'socket' def port_available?