Sha256: 7aaf78737e0ca801c64697419df5ff972227e7092abd7e0ff156422f97e81fa3

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

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

    describe "#check" do
      subject { AgentCompatibilityCheck.new(:default_data_port) }
      context "runs all check methods" do
        it "successfully checks open ports" do
          expect(subject).to receive(:can_connect_to_port?).with(Flydata::AgentCompatibilityCheck::TCP_PORT).and_return true
          expect(subject).to receive(:can_connect_to_port?).with(Flydata::AgentCompatibilityCheck::SSL_PORT).and_return true
          subject.check
        end
        it "successfully catches errors on open ports" do
          expect(subject).to receive(:can_connect_to_port?).with(Flydata::AgentCompatibilityCheck::TCP_PORT).and_return true
          expect(subject).to receive(:can_connect_to_port?).with(Flydata::AgentCompatibilityCheck::SSL_PORT).and_return false
          expect{subject.check_outgoing_ports}.to raise_error(Flydata::AgentCompatibilityCheck::AgentCompatibilityError, /ports/)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flydata-0.2.12 spec/flydata/compatibility_check_spec.rb