Sha256: 2ca68af8b21a599ad7eef7bebeaad22ead7745d9770f56fe55d475ce3a5bc968

Contents?: true

Size: 1.08 KB

Versions: 93

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.2)
    expect(subject.max.name).to eq("TLSv1.2")
  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

93 entries across 93 versions & 1 rubygems

Version Path
logstash-input-beats-6.2.6-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-5.1.11-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.2.5-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-5.1.10-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.2.4-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.2.3-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.2.2-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.2.1-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.2.0-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.1.6-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.1.5-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.1.4-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.1.3-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.1.2-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.1.1-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.1.0-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.0.14-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.0.13-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.0.12-java spec/inputs/beats/tls_spec.rb
logstash-input-beats-6.0.11-java spec/inputs/beats/tls_spec.rb