/usr/lib/ruby/vendor_ruby/serverspec/matcher/be_reachable.rb is in ruby-serverspec 2.37.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | RSpec::Matchers.define :be_reachable do
match do |host|
proto = 'tcp'
timeout = 5
if @attr
port = @attr[:port]
proto = @attr[:proto] if @attr[:proto]
timeout = @attr[:timeout] if @attr[:timeout]
end
host.reachable?(port, proto, timeout)
end
chain :with do |attr|
@attr = attr
end
end
|