Sha256: 9ac986da50b4e4a741731c3f4fcfbbff35d8ab365be99f6ad43b86f5f067844f

Contents?: true

Size: 1.35 KB

Versions: 8

Compression:

Stored size: 1.35 KB

Contents

require 'spec_helper'

describe Specinfra::Command::Module::Ss do
  class Specinfra::Command::Module::Ss::Test < Specinfra::Command::Base
    extend Specinfra::Command::Module::Ss
  end
  let(:klass) { Specinfra::Command::Module::Ss::Test }
  it { expect(klass.check_is_listening('80')).to eq 'ss -tunl | grep -- :80\ ' }
  it { expect(klass.check_is_listening('80', options={:protocol => 'tcp'})).to eq 'ss -tnl | grep -- :80\ ' }
  it { expect(klass.check_is_listening('80', options={:protocol => 'udp'})).to eq 'ss -unl | grep -- :80\ ' }
  it { expect(klass.check_is_listening('80', options={:local_address => '0.0.0.0'})).to eq 'ss -tunl | grep -- \ \*:80\ ' }
  it { expect(klass.check_is_listening('80', options={:local_address => '0.0.0.0', :protocol => 'tcp'})).to eq 'ss -tnl | grep -- \ \*:80\ ' }
  it { expect(klass.check_is_listening('80', options={:local_address => '0.0.0.0', :protocol => 'udp'})).to eq 'ss -unl | grep -- \ \*:80\ ' }
  it { expect(klass.check_is_listening('80', options={:local_address => '1.2.3.4'})).to eq 'ss -tunl | grep -- \ 1.2.3.4:80\ ' }
  it { expect(klass.check_is_listening('80', options={:local_address => '1.2.3.4', :protocol => 'tcp'})).to eq 'ss -tnl | grep -- \ 1.2.3.4:80\ ' }
  it { expect(klass.check_is_listening('80', options={:local_address => '1.2.3.4', :protocol => 'udp'})).to eq 'ss -unl | grep -- \ 1.2.3.4:80\ ' }
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
specinfra-2.39.1 spec/command/module/ss_spec.rb
specinfra-2.39.0 spec/command/module/ss_spec.rb
specinfra-2.38.1 spec/command/module/ss_spec.rb
specinfra-2.38.0 spec/command/module/ss_spec.rb
specinfra-2.37.9 spec/command/module/ss_spec.rb
specinfra-2.37.8 spec/command/module/ss_spec.rb
specinfra-2.37.6 spec/command/module/ss_spec.rb
specinfra-2.37.5 spec/command/module/ss_spec.rb