Sha256: 7f9530aad0de493d10989962a6577979f554beaadd3cc978211bcfee2956b09e

Contents?: true

Size: 900 Bytes

Versions: 5

Compression:

Stored size: 900 Bytes

Contents

require 'spec_helper'

set :os, :family => 'freebsd'

describe commands.command_class('port').create do
  it { should be_an_instance_of(Specinfra::Command::Freebsd::Base::Port) }
end

describe Serverspec::Type::Port do
  describe port(80) do
    it { should be_listening }

    it('protocol: tcp') { should be_listening.with('tcp') }

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

    it('on: 127.0.0.1') do
      should be_listening.on('127.0.0.1')
    end

    it 'invalid local address raises error' do
      expect{ should be_listening.on('') }.to raise_error(ArgumentError)
    end
  end

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

  describe port(123) do
    it { should be_listening.with("udp") }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
serverspec-2.0.0.beta13 spec/type/freebsd/port_spec.rb
serverspec-2.0.0.beta12 spec/type/freebsd/port_spec.rb
serverspec-2.0.0.beta11 spec/type/freebsd/port_spec.rb
serverspec-2.0.0.beta10 spec/type/freebsd/port_spec.rb
serverspec-2.0.0.beta9 spec/type/freebsd/port_spec.rb