Sha256: 8b37082c569b599656ca11e26fdd932847e53e8f35c1d1c1a120fbb4852bcb9a

Contents?: true

Size: 1.16 KB

Versions: 28

Compression:

Stored size: 1.16 KB

Contents

# encoding: utf-8
require 'logstash-integration-kafka_jars'

describe "[DOCS]" do

  let(:docs_files) do
    ['index.asciidoc', 'input-kafka.asciidoc', 'output-kafka.asciidoc'].map { |name| File.join('docs', name) }
  end

  let(:kafka_version_properties) do
    loader = java.lang.Thread.currentThread.getContextClassLoader
    version = loader.getResource('kafka/kafka-version.properties')
    fail "kafka-version.properties missing" unless version
    properties = java.util.Properties.new
    properties.load version.openStream
    properties
  end

  it 'is sync-ed with Kafka client version' do
    version = kafka_version_properties.get('version') # e.g. '2.5.1'

    fails = docs_files.map do |file|
      if line = File.readlines(file).find { |line| line.index(':kafka_client:') }
        puts "found #{line.inspect} in #{file}" if $VERBOSE # e.g. ":kafka_client: 2.5\n"
        if !version.start_with?(line.strip.split[1])
          "documentation at #{file} is out of sync with kafka-clients version (#{version.inspect}), detected line: #{line.inspect}"
        else
          nil
        end
      end
    end

    fail "\n" + fails.join("\n") if fails.flatten.any?
  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
logstash-integration-kafka-11.6.0-java spec/check_docs_spec.rb
logstash-integration-kafka-11.5.4-java spec/check_docs_spec.rb
logstash-integration-kafka-11.5.3-java spec/check_docs_spec.rb
logstash-integration-kafka-11.5.2-java spec/check_docs_spec.rb
logstash-integration-kafka-11.5.1-java spec/check_docs_spec.rb
logstash-integration-kafka-11.5.0-java spec/check_docs_spec.rb
logstash-integration-kafka-11.4.1-java spec/check_docs_spec.rb
logstash-integration-kafka-11.4.0-java spec/check_docs_spec.rb
logstash-integration-kafka-11.3.4-java spec/check_docs_spec.rb
logstash-integration-kafka-11.3.3-java spec/check_docs_spec.rb
logstash-integration-kafka-11.3.2-java spec/check_docs_spec.rb
logstash-integration-kafka-10.12.1-java spec/check_docs_spec.rb
logstash-integration-kafka-11.3.1-java spec/check_docs_spec.rb
logstash-integration-kafka-11.3.0-java spec/check_docs_spec.rb
logstash-integration-kafka-11.2.1-java spec/check_docs_spec.rb
logstash-integration-kafka-11.2.0-java spec/check_docs_spec.rb
logstash-integration-kafka-11.1.0-java spec/check_docs_spec.rb
logstash-integration-kafka-11.0.0-java spec/check_docs_spec.rb
logstash-integration-kafka-10.12.0-java spec/check_docs_spec.rb
logstash-integration-kafka-10.11.0-java spec/check_docs_spec.rb