Sha256: c509fe26c243d1453f323bde57f7a49b5ed2a0015a72e6d12cf4af54b41d4afc

Contents?: true

Size: 816 Bytes

Versions: 6

Compression:

Stored size: 816 Bytes

Contents

require 'spec_helper'

include Serverspec::Helper::Solaris

describe port(80) do
  it { should be_listening }
  its(:command) { should eq %q!netstat -an 2> /dev/null | egrep 'LISTEN|Idle' | grep -- .80\\ ! }
end

describe port('invalid') do
  it { should_not be_listening }
end

describe port(80) do
  it { should be_listening.with("tcp") }
  its(:command) { should eq %q!netstat -an -P tcp 2> /dev/null | egrep 'LISTEN|Idle' | grep -- .\\*.80\\ ! }
end

describe port(123) do
  it { should be_listening.with("udp") }
  its(:command) { should eq %q!netstat -an -P udp 2> /dev/null | egrep 'LISTEN|Idle' | grep -- .\\*.123\\ ! }
end

describe port(80) do
  it { 
    expect {
      should be_listening.with('not implemented')
    }.to raise_error(ArgumentError, %r/\A`be_listening` matcher doesn\'t support/)
  }
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
serverspec-0.6.27 spec/solaris/port_spec.rb
serverspec-0.6.26 spec/solaris/port_spec.rb
serverspec-0.6.25 spec/solaris/port_spec.rb
serverspec-0.6.24 spec/solaris/port_spec.rb
serverspec-0.6.23 spec/solaris/port_spec.rb
serverspec-0.6.22 spec/solaris/port_spec.rb