Sha256: aaf259d7d11f7a0bebf9c324fc21f3abbcb5b6afeece2cf9f478b1e0f5a555e0
Contents?: true
Size: 1.03 KB
Versions: 45
Compression:
Stored size: 1.03 KB
Contents
require 'spec_helper' require 'flydata/compatibility_check' module Flydata describe AgentCompatibilityCheck do let(:subject_object) { AgentCompatibilityCheck.new("servers" => ['localhost']) } let(:default_data_port) do { "servers"=>["sample-test-site.com"] } end let(:sock) { double('sock') } before do allow(sock).to receive(:close) end describe "#check" do subject { subject_object.check } context "when all ports are accessible" do before do allow(TCPSocket).to receive(:new).and_return(sock) end it "does nothing" do subject end end end describe '#check_outgoing_ports' do subject { subject_object.check_outgoing_ports } context "when a port access fails" do before do allow(TCPSocket).to receive(:new).and_raise(Errno::ETIMEDOUT) end it do expect{subject}.to raise_error(FlydataCore::AgentCompatibilityError, /ports/) end end end end end
Version data entries
45 entries across 45 versions & 1 rubygems