Sha256: 9f654c318290785d3373f484c37e5687e33bdbacfed8e6ecfd428a35e9ca967d

Contents?: true

Size: 1011 Bytes

Versions: 2

Compression:

Stored size: 1011 Bytes

Contents

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

describe Ronin::Exploits::Params::BindPort do
  module TestBindPortParam
    class TestExploit < Ronin::Exploits::Exploit
      include Ronin::Exploits::Params::BindPort
    end
  end

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

    it "must add an optional 'bind_port' param to the exploit class" do
      expect(subject.params[:bind_port]).to_not be_nil
      expect(subject.params[:bind_port].type).to be_kind_of(Ronin::Core::Params::Types::Integer)
      expect(subject.params[:bind_port].required?).to be(false)
      expect(subject.params[:bind_port].desc).to eq("Local port to bind to")
    end
  end

  let(:bind_port) { 9000 }
  subject do
    TestBindPortParam::TestExploit.new(
      params: {bind_port: bind_port}
    )
  end

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

Version data entries

2 entries across 2 versions & 1 rubygems

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