35 lines
824 B
Ruby
35 lines
824 B
Ruby
# encoding: UTF-8
|
|
|
|
require 'spec_helper'
|
|
|
|
describe Vulnerability::Output do
|
|
let(:modules_url) { 'http://www.metasploit.com/modules/' }
|
|
|
|
describe '::metasploit_module_url' do
|
|
after :each do
|
|
Vulnerability::Output.metasploit_module_url(@module).should == @expected
|
|
end
|
|
|
|
it 'removes the leading slash' do
|
|
@module = '/exploit/testing'
|
|
@expected = modules_url + 'exploit/testing'
|
|
end
|
|
|
|
it 'returns the correct url' do
|
|
@module = 'gathering/yolo'
|
|
@expected = modules_url + @module
|
|
end
|
|
end
|
|
|
|
describe '::cve_url' do
|
|
it 'returns the correct url' do
|
|
Vulnerability::Output.cve_url('1111-1111').should == 'http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-1111-1111'
|
|
end
|
|
end
|
|
|
|
describe '#output' do
|
|
# How to test it ? oO
|
|
end
|
|
|
|
end
|