Sha256: e458724d80a4a832f7fb5937d68ad42cc8efb641b02bb45b3872ab4791bbfd6d

Contents?: true

Size: 965 Bytes

Versions: 6

Compression:

Stored size: 965 Bytes

Contents

module Flydata
  describe AgentCompatibilityCheck do
    let(:default_data_port) do
      {
        "servers"=>["sample-test-site.com"]
      }
     end

    describe "#check" do
      subject { AgentCompatibilityCheck.new("servers" => ['localhost']) }
      context "runs all check methods" do
        context "when all ports are accessible" do
          let(:sock) { double('sock') }
          before do
            allow(TCPSocket).to receive(:new).and_return(sock)
            allow(sock).to receive(:close)
          end
          it "does nothing" do
            subject.check
          end
        end
        context "when a port access fails" do
          before do
            allow(TCPSocket).to receive(:new).and_raise(Errno::ETIMEDOUT)
          end
          it do
            expect{subject.check_outgoing_ports}.to raise_error(Flydata::AgentCompatibilityCheck::AgentCompatibilityError, /ports/)
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
flydata-0.2.19 spec/flydata/compatibility_check_spec.rb
flydata-0.2.18 spec/flydata/compatibility_check_spec.rb
flydata-0.2.17 spec/flydata/compatibility_check_spec.rb
flydata-0.2.16 spec/flydata/compatibility_check_spec.rb
flydata-0.2.15 spec/flydata/compatibility_check_spec.rb
flydata-0.2.13 spec/flydata/compatibility_check_spec.rb