-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# | ||
# Copyright (c) 2006-2015 Wade Alcorn - [email protected] | ||
# Browser Exploitation Framework (BeEF) - http://beefproject.com | ||
# See the file 'doc/COPYING' for copying permission | ||
# | ||
require 'test/unit' | ||
|
||
class TC_Qrcode < Test::Unit::TestCase | ||
|
||
class << self | ||
|
||
def startup | ||
$root_dir = '../../' | ||
$:.unshift(File.expand_path($root_dir)) | ||
|
||
# load extension | ||
require 'extensions/qrcode/extension' | ||
|
||
# load config | ||
BeEF::Core::Configuration.new(File.join($root_dir, 'config.yaml')) | ||
config = BeEF::Core::Configuration.instance | ||
config.load_extensions_config | ||
@@qrcode_config = config.get('beef.extension.qrcode') | ||
end | ||
|
||
def shutdown | ||
$root_dir = nil | ||
end | ||
|
||
end | ||
|
||
# Connects to in-memory database (does not test anything) | ||
def test_01_database | ||
DataMapper.setup(:default, 'sqlite3::memory:') | ||
DataMapper.auto_migrate! | ||
end | ||
|
||
# Checks for required settings in config file | ||
def test_02_config | ||
assert(@@qrcode_config.has_key?('enable')) | ||
assert(@@qrcode_config.has_key?('targets')) | ||
assert(@@qrcode_config.has_key?('qrsize')) | ||
assert(@@qrcode_config.has_key?('qrborder')) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters