Sha256: 4793726a8238fca118fb08d7e4e904248dad2d05c5dbc3fc402aa559fa3042e7

Contents?: true

Size: 992 Bytes

Versions: 3

Compression:

Stored size: 992 Bytes

Contents

require 'ronin/exploits/web'

require 'spec_helper'

describe Exploits::Web do
  describe "targeted_url" do
    it "should initialize all parameters by default" do
      exploit = Exploits::Web.new
      
      exploit.params.should_not be_empty
    end

    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

3 entries across 3 versions & 1 rubygems

Version Path
ronin-exploits-0.3.1 spec/exploits/web_spec.rb
ronin-exploits-0.3.0 spec/exploits/web_spec.rb
ronin-exploits-0.2.1 spec/exploits/web_spec.rb