From 804fc6363ae8ed3adcea1c744cbe94cbc0ddb912 Mon Sep 17 00:00:00 2001 From: Jack Walker Date: Thu, 16 Apr 2020 08:54:04 +1000 Subject: [PATCH] Implemented BrowserStack testing into debug module tests. --- .../modules/debug/test_beef_debugs_spec.rb | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/spec/beef/modules/debug/test_beef_debugs_spec.rb b/spec/beef/modules/debug/test_beef_debugs_spec.rb index bbbc4afd5..d434493e9 100644 --- a/spec/beef/modules/debug/test_beef_debugs_spec.rb +++ b/spec/beef/modules/debug/test_beef_debugs_spec.rb @@ -33,13 +33,13 @@ RSpec.describe 'BeEF Debug Command Modules:' do end # Load up DB and migrate if necessary - ActiveRecord::Base.logger = nil - OTR::ActiveRecord.migrations_paths = [File.join('core', 'main', 'ar-migrations')] + ActiveRecord::Base.logger = nil + OTR::ActiveRecord.migrations_paths = [File.join('core', 'main', 'ar-migrations')] OTR::ActiveRecord.configure_from_hash!(adapter:'sqlite3', database: db_file) - context = ActiveRecord::Migration.new.migration_context - if context.needs_migration? - ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate + context = ActiveRecord::Migration.new.migration_context + if context.needs_migration? + ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate end sleep 10 @@ -51,15 +51,15 @@ RSpec.describe 'BeEF Debug Command Modules:' do http_hook_server.prepare # Generate a token for the server to respond with - BeEF::Core::Crypto::api_token + BeEF::Core::Crypto::api_token # Initiate server start-up @pids = fork do BeEF::API::Registrar.instance.fire(BeEF::API::Server, 'pre_http_start', http_hook_server) - end - @pid = fork do - http_hook_server.start - end + end + @pid = fork do + http_hook_server.start + end # Give the server time to start-up sleep 1 @@ -80,7 +80,7 @@ RSpec.describe 'BeEF Debug Command Modules:' do after(:all) do Process.kill("KILL",@pid) - Process.kill("KILL",@pids) + Process.kill("KILL",@pids) end it 'The Test_beef.debug() command module successfully executes' do @@ -161,4 +161,4 @@ RSpec.describe 'BeEF Debug Command Modules:' do result_data = JSON.parse(response.body) expect(result_data['success']).to eq "true" end -end \ No newline at end of file +end