2005-12-17 06:46:23 +00:00
|
|
|
#!/usr/bin/env ruby
|
2005-06-05 00:33:38 +00:00
|
|
|
|
2005-06-09 06:18:27 +00:00
|
|
|
$:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..'))
|
2005-06-05 00:33:38 +00:00
|
|
|
|
|
|
|
require 'test/unit'
|
2005-07-09 21:18:49 +00:00
|
|
|
require 'msf/core'
|
2005-06-05 00:33:38 +00:00
|
|
|
|
|
|
|
module Msf
|
|
|
|
|
|
|
|
class Module::Reference::UnitTest < Test::Unit::TestCase
|
|
|
|
def test_ref
|
|
|
|
assert_equal('some cool book', Reference.from_s('some cool book').to_s)
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_site_ref
|
|
|
|
assert_equal('ftp://www.google.com', SiteReference.from_s('ftp://www.google.com').to_s)
|
|
|
|
assert_equal('http://www.google.com', SiteReference.from_s('http://www.google.com').to_s)
|
|
|
|
assert_equal('https://www.google.com', SiteReference.from_s('https://www.google.com').to_s)
|
|
|
|
assert_equal('http://www.osvdb.org/1', SiteReference.from_a([ 'OSVDB', 1 ]).to_s)
|
|
|
|
assert_equal('http://www.osvdb.org/1', SiteReference.from_a([ 'OSVDB', 1 ]).to_s)
|
|
|
|
assert_equal('jones (a)', SiteReference.from_a([ 'jones', 'a' ]).to_s)
|
|
|
|
assert_nil(SiteReference.from_s('whatever invalid shizzy'))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2008-10-19 21:03:39 +00:00
|
|
|
end
|