Sha256: 98939431837b8922e2bb21d467d36cf30ebf7c0e94fce3b9ee50653d7b963698

Contents?: true

Size: 775 Bytes

Versions: 2

Compression:

Stored size: 775 Bytes

Contents

require 'spec_helper'
require 'nmap/task'

describe Task do
  describe "ports" do
    it "should ignore empty port Arrays" do
      subject.ports = []

      subject.arguments.should == []
    end

    it "should format a String of ports" do
      subject.ports = '80,21,25'

      subject.arguments.should == %w[-p 80,21,25]
    end

    it "should format an Array of String ports" do
      subject.ports = %w[80 21 25]

      subject.arguments.should == %w[-p 80,21,25]
    end

    it "should format an Array of Integer ports" do
      subject.ports = [80, 21, 25]

      subject.arguments.should == %w[-p 80,21,25]
    end

    it "should format a Range of ports" do
      subject.ports = [80, 21..25]

      subject.arguments.should == %w[-p 80,21-25]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-nmap-0.7.0 spec/task_spec.rb
ruby-nmap-0.6.0 spec/task_spec.rb