Sha256: 6a55e7a0d552fb304f55dc7584b24d664c3d810c7050bec5f8879b4a14a3f876

Contents?: true

Size: 845 Bytes

Versions: 1

Compression:

Stored size: 845 Bytes

Contents

require 'ronin/exploits/web'

require 'spec_helper'

describe Exploits::Web do
  describe "targeted_url" do
    it "should create a targeted URL using the host param" do
      host = 'www.example.com'
      exploit = Exploits::Web.new(:host => host)

      exploit.targeted_url.host.should == host
    end

    it "should create a targeted URL using the host param and the url_path property" do
      host = 'www.example.com'
      path = '/'
      exploit = Exploits::Web.new(:host => host, :url_path => path)

      exploit.targeted_url.host.should == host
      exploit.targeted_url.path.should == path
    end

    it "should raise a MissingParam exception if host params is missing" do
      exploit = Exploits::Web.new(:url_path => '/')

      lambda { exploit.targeted_url }.should raise_error(Parameters::MissingParam)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ronin-exploits-0.2.0 spec/exploits/web_spec.rb