Sha256: 7c8551f38694fe2f49f38309429e2685386d12a62c2881970169d9d393b783fb

Contents?: true

Size: 1.32 KB

Versions: 34

Compression:

Stored size: 1.32 KB

Contents

# encoding: utf-8
require_relative "../../spec_helper"
require_relative "../../../support/shared_examples"
require "sinatra"
require "logstash/api/modules/plugins"
require "logstash/json"

describe LogStash::Api::Modules::Plugins do
  include_context "api setup"
  include_examples "not found"

  before(:each) do
    get "/"
  end

  let(:payload) { LogStash::Json.load(last_response.body) }

  it "respond to plugins resource" do
    expect(last_response).to be_ok
  end

  it "return valid json content type" do
    expect(last_response.content_type).to eq("application/json"), "Did not get json, got #{last_response.content_type} / #{last_response.body}"
  end

  context "#schema" do
    it "return the expected schema" do
      expect(payload.keys).to include("plugins", "total")
      payload["plugins"].each do |plugin|
        expect(plugin.keys).to include("name", "version")
      end
    end
  end

  context "#values" do

    it "return totals of plugins" do
      expect(payload["total"]).to eq(payload["plugins"].count)
    end

    it "return a list of available plugins" do
      payload["plugins"].each do |plugin|
        expect(plugin).to be_available?
      end
    end

    it "return non empty version values" do
      payload["plugins"].each do |plugin|
        expect(plugin["version"]).not_to be_empty
      end
    end
  end
end

Version data entries

34 entries across 33 versions & 9 rubygems

Version Path
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/logstash-core-5.2.1-java/spec/api/lib/api/plugins_spec.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/logstash-core-5.2.1-java/spec/api/lib/api/plugins_spec.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/logstash-core-5.0.0-java/spec/api/lib/api/plugins_spec.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/logstash-core-5.2.1-java/spec/api/lib/api/plugins_spec.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/logstash-core-5.2.1-java/spec/api/lib/api/plugins_spec.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/logstash-core-5.4.0-java/spec/api/lib/api/plugins_spec.rb
logstash-core-5.4.3-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.4.2-java spec/api/lib/api/plugins_spec.rb
logstash-filter-csharp-0.1.0 vendor/bundle/jruby/2.3.0/gems/logstash-core-5.2.1-java/spec/api/lib/api/plugins_spec.rb
logstash-core-5.4.1-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.3.3-java spec/api/lib/api/plugins_spec.rb
logstash-filter-htmlentities-0.1.0 vendor/bundle/jruby/1.9/gems/logstash-core-5.4.0-java/spec/api/lib/api/plugins_spec.rb
logstash-output-icinga-1.0.0 vendor/jruby/1.9/gems/logstash-core-5.2.1-java/spec/api/lib/api/plugins_spec.rb
logstash-core-6.0.0.alpha1-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.4.0-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.3.2-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.3.1-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.3.0-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.2.2-java spec/api/lib/api/plugins_spec.rb
logstash-input-fifo-0.9.1 vendor/bundle/jruby/1.9/gems/logstash-core-5.1.1.1-java/spec/api/lib/api/plugins_spec.rb