Sha256: 43e9c86c68a7232a0bced19eaf5ec1071d7bcc1d3837bb5fa57c5a556ebb4b97

Contents?: true

Size: 799 Bytes

Versions: 6

Compression:

Stored size: 799 Bytes

Contents

require 'spec_helper'
require 'nmap/task'

describe Task do
  subject { Task.new }

  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

6 entries across 6 versions & 1 rubygems

Version Path
ruby-nmap-0.5.1 spec/task_spec.rb
ruby-nmap-0.5.0 spec/task_spec.rb
ruby-nmap-0.4.1 spec/task_spec.rb
ruby-nmap-0.4.0 spec/task_spec.rb
ruby-nmap-0.3.0 spec/task_spec.rb
ruby-nmap-0.2.0 spec/task_spec.rb