Sha256: 6c199a26be1359067df4d70b540b062dabd331956e4c364cf284d91ce108f2d1

Contents?: true

Size: 872 Bytes

Versions: 6

Compression:

Stored size: 872 Bytes

Contents

require 'spec_helper'
require 'sequence_examples'

require 'nmap/tcp_sequence'

describe TcpSequence do
  subject { @xml.hosts.first.tcp_sequence }

  describe "#index" do
    it "should parse the index" do
      expect(subject.index).to be > 0
    end
  end

  describe "#description" do
    it "should parse the difficulty description" do
      expect(subject.difficulty).to eq("Good luck!")
    end
  end

  describe "#to_s" do
    let(:index_regexp) do
      /\d+/
    end

    let(:difficulty_regexp) do
      /"(Good luck!)"/
    end

    let(:values_regexp) do
      /\[\d+(, \d+){5}\]/
    end

    let(:regexp) do
      /^index=#{index_regexp} difficulty=#{difficulty_regexp} values=#{values_regexp}$/
    end

    it "should contain the description and values" do
      expect(subject.to_s).to match(regexp)
    end
  end

  it_should_behave_like "Sequence"
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-nmap-0.10.0 spec/tcp_sequence_spec.rb
ruby-nmap-0.9.3 spec/tcp_sequence_spec.rb
ruby-nmap-0.9.2 spec/tcp_sequence_spec.rb
ruby-nmap-0.9.1 spec/tcp_sequence_spec.rb
ruby-nmap-0.9.0 spec/tcp_sequence_spec.rb
ruby-nmap-0.8.0 spec/tcp_sequence_spec.rb