Sha256: f12d2d60b986f41a604671735427c41469be6f8227e89a0b01bd6d1f40c26611

Contents?: true

Size: 1.08 KB

Versions: 22

Compression:

Stored size: 1.08 KB

Contents

# encoding: utf-8
require "logstash/inputs/beats/tls"

describe LogStash::Inputs::Beats::TLS do
  subject { described_class }

  it "returns the minimum supported tls" do
    expect(subject.min.version).to eq(1)
    expect(subject.min.name).to eq("TLSv1")
  end

  it "returns the maximum supported tls" do
    expect(subject.max.version).to eq(1.3)
    expect(subject.max.name).to eq("TLSv1.3")
  end

  describe ".get_supported" do
    context "when a range is given" do
      it "returns the list of compatible TLS from a range" do
        expect(subject.get_supported((1.1)..(1.2)).map(&:version)).to match([1.1, 1.2])
      end

      it "it return an empty array when nothing match" do
        expect(subject.get_supported((3.1)..(8.2))).to be_empty
      end
    end

    context "when a scalar is given" do
      it "when a scalar is given we return the compatible value" do
        expect(subject.get_supported(1.1).map(&:version)).to match([1.1])
      end


      it "it return an empty array when nothing match" do
        expect(subject.get_supported(9)).to be_empty
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
logstash-input-beats-6.9.1-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.9.0-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.8.4-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.8.3-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.8.2-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.8.1-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.8.0-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.7.2-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.7.1-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.7.0-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.6.4-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.6.3-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.6.2-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.6.1-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.6.0-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.5.0-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.4.4-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.4.3-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.4.1-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.4.0-java spec/inputs/beats/tls_spec.rb