Sha256: b4d4ef7544a04cc6e49ff7653b8c55b12e7330b688ab5c8598dbdaa4bcd1278f

Contents?: true

Size: 921 Bytes

Versions: 2

Compression:

Stored size: 921 Bytes

Contents

require 'spec_helper'
require 'ronin/exploits/params/bind_host'
require 'ronin/exploits/exploit'

describe Ronin::Exploits::Params::BindHost do
  module TestBindHostParam
    class TestExploit < Ronin::Exploits::Exploit
      include Ronin::Exploits::Params::BindHost
    end
  end

  describe ".included" do
    subject { TestBindHostParam::TestExploit }

    it "must add an optional 'bind_host' param to the exploit class" do
      expect(subject.params[:bind_host]).to_not be_nil
      expect(subject.params[:bind_host].required?).to be(false)
      expect(subject.params[:bind_host].desc).to eq("Local host to bind to")
    end
  end

  let(:bind_host) { 'localhost' }
  subject do
    TestBindHostParam::TestExploit.new(
      params: {bind_host: bind_host}
    )
  end

  describe "#bind_host" do
    it "must return the bind_host param value" do
      expect(subject.bind_host).to eq(bind_host)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ronin-exploits-1.0.0.beta2 spec/params/bind_host_spec.rb
ronin-exploits-1.0.0.beta1 spec/params/bind_host_spec.rb