Skip to content

Commit

Permalink
Add Ipec unit test stub - Fix #586
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoles committed Sep 9, 2015
1 parent 3ef4715 commit fe8aace
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions test/unit/extensions/tc_ipec_tunnel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,43 @@

class TC_IpecTunnel < Test::Unit::TestCase

def setup
$:.unshift(File.join(File.expand_path(File.dirname(__FILE__)), '.'))
$root_dir = File.expand_path('../../../../', __FILE__)
class << self

def startup
$root_dir = '../../'
$:.unshift(File.expand_path($root_dir))

# load extension
require 'extensions/ipec/extension'

# load config
BeEF::Core::Configuration.new(File.join($root_dir, 'config.yaml'))
config = BeEF::Core::Configuration.instance
config.load_extensions_config
@@ipec_config = config.get('beef.extension.ipec')
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(@@ipec_config.has_key?('enable'))
end

def test_ipec_tunnel
assert(true)
# Verifies public interface
def test_03_interface
@@ipec_junk_calc = BeEF::Extension::Ipec::JunkCalculator.instance
assert_respond_to(@@ipec_junk_calc, :bind_junk_calculator)
end

end

0 comments on commit fe8aace

Please sign in to comment.