Sha256: 5fcdd8b0c501c10d885d274f578f646af8ea06484936c3e69643e5bf65bd7f96

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

set :os, :family => 'base'

describe host('127.0.0.1') do
  it { should be_resolvable }
end

describe host('invalid-name') do
  it { should_not be_resolvable }
end

describe host('127.0.0.1') do
  it { should be_resolvable.by('hosts') }
end

describe host('invalid-name') do
  it { should_not be_resolvable.by('hosts') }
end

describe host('127.0.0.1') do
  it { should be_resolvable.by('dns') }
end

describe host('invalid-name') do
  it { should_not be_resolvable.by('dns') }
end

describe host('127.0.0.1') do
  it { should be_reachable }
end

describe host('invalid-host') do
  it { should_not be_reachable }
end

describe host('127.0.0.1') do
  it { should be_reachable.with(:proto => "icmp", :timeout=> 1) }
end

describe host('127.0.0.1') do
  it { should be_reachable.with(:proto => "tcp", :port => 22, :timeout=> 1) }
end

describe host('127.0.0.1') do
  it { should be_reachable.with(:proto => "udp", :port => 53, :timeout=> 1) }
end

describe host('invalid-host') do
  it { should_not be_reachable.with(:proto => "udp", :port => 53, :timeout=> 1) }
end

describe host('example.jp') do
  let(:stdout) { "1.2.3.4\r\n" }
  its(:ipaddress) { should eq '1.2.3.4' }
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
serverspec-2.0.0.beta19 spec/type/base/host_spec.rb
serverspec-2.0.0.beta18 spec/type/base/host_spec.rb
serverspec-2.0.0.beta17 spec/type/base/host_spec.rb
serverspec-2.0.0.beta16 spec/type/base/host_spec.rb
serverspec-2.0.0.beta15 spec/type/base/host_spec.rb
serverspec-2.0.0.beta14 spec/type/base/host_spec.rb