Merge branch 'rspec-conversion'

* Converted tests to rspec for future releases + travis integration.
* Files remaining in test/ are integrations that require verification if they are still relevant/working.
This commit is contained in:
Ben Passmore
2019-09-26 13:40:29 +10:00
59 changed files with 1287 additions and 1970 deletions

View File

@@ -15,7 +15,8 @@ module Core
@config = BeEF::Core::Configuration.instance
# if notifications are enabled create a new instance
@notifications = BeEF::Extension::Notifications::Notifications unless @config.get('beef.extension.notifications.enable') == false
notifications_enabled = @config.get('beef.extension.notifications.enable')
@notifications = BeEF::Extension::Notifications::Notifications unless (notifications_enabled == false or notifications_enabled.nil?)
end
#

View File

@@ -7,14 +7,14 @@
# Function used to print errors to the console
# @param [String] s String to be printed
def print_error(s)
puts Time.now.localtime.strftime("[%k:%M:%S]")+'[!]'.red+' '+s
puts Time.now.localtime.strftime("[%k:%M:%S]")+'[!]'+' '+s
BeEF.logger.error s.to_s
end
# Function used to print information to the console
# @param [String] s String to be printed
def print_info(s)
puts Time.now.localtime.strftime("[%k:%M:%S]")+'[*]'.blue+' '+s
puts Time.now.localtime.strftime("[%k:%M:%S]")+'[*]'+' '+s
BeEF.logger.info s.to_s
end
@@ -27,7 +27,7 @@ end
# Function used to print warning information
# @param [String] s String to be printed
def print_warning(s)
puts Time.now.localtime.strftime("[%k:%M:%S]")+'[!]'.yellow+' '+s.to_s
puts Time.now.localtime.strftime("[%k:%M:%S]")+'[!]'+' '+s.to_s
BeEF.logger.warn s.to_s
end
@@ -37,7 +37,7 @@ end
def print_debug(s)
config = BeEF::Core::Configuration.instance
if config.get('beef.debug') || BeEF::Core::Console::CommandLine.parse[:verbose]
puts Time.now.localtime.strftime("[%k:%M:%S]")+'[>]'.yellow+' '+s.to_s
puts Time.now.localtime.strftime("[%k:%M:%S]")+'[>]'+' '+s.to_s
BeEF.logger.debug s.to_s
end
end
@@ -45,7 +45,7 @@ end
# Function used to print successes to the console
# @param [String] s String to be printed
def print_success(s)
puts Time.now.localtime.strftime("[%k:%M:%S]")+'[+]'.green+' '+s
puts Time.now.localtime.strftime("[%k:%M:%S]")+'[+]'+' '+s
BeEF.logger.info s.to_s
end