Sha256: 45a2b136e0944b31f0c7dafed41ce231489a0c7888bfbcbcc0d8586ed5def58f

Contents?: true

Size: 742 Bytes

Versions: 1

Compression:

Stored size: 742 Bytes

Contents

require 'spec_helper'
require 'nmap/port'

describe Port do
  subject { @xml.hosts.first.ports.first }

  it "should parse the protocol" do
    subject.protocol.should == :tcp
  end

  it "should parse the port number" do
    subject.number.should == 22
  end

  it "should parse the state" do
    subject.state.should == :open
  end

  it "should parse the reason" do
    subject.reason.should == 'syn-ack'
  end

  describe "#service" do
    subject { super().service }

    it "should return a Service object" do
      subject.should be_kind_of(Service)
    end
  end

  include_examples "#scripts"

  describe "#inspect" do
    it "should include the number" do
      subject.inspect.should include(subject.number.to_s)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-nmap-0.7.0 spec/port_spec.rb