Sha256: 81353a8894943beca42fc92363b69be8425375784812331ecf66162a1c8d24dc

Contents?: true

Size: 1.24 KB

Versions: 16

Compression:

Stored size: 1.24 KB

Contents

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

describe LogStash::Api::Modules::Plugins do
  include_context "api setup"

  before(:all) 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

16 entries across 16 versions & 3 rubygems

Version Path
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/api/plugins_spec.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/api/plugins_spec.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/api/plugins_spec.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/api/plugins_spec.rb
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/api/plugins_spec.rb
logstash-filter-base64-1.0.2 vendor/bundle/jruby/2.3.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/api/plugins_spec.rb
logstash-filter-base64-1.0.1 vendor/bundle/jruby/2.3.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/api/plugins_spec.rb
logstash-filter-base64-1.0.0 vendor/bundle/jruby/2.3.0/gems/logstash-core-5.0.0.alpha6.snapshot5-java/spec/api/lib/api/plugins_spec.rb
logstash-core-5.0.0.alpha6.snapshot5-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.0.0.alpha6.snapshot4-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.0.0.alpha6.snapshot3-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.0.0.alpha6.snapshot2-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.0.0.alpha6.snapshot1-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.0.0.alpha5.snapshot1-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.0.0.alpha4.snapshot3-java spec/api/lib/api/plugins_spec.rb
logstash-core-5.0.0.alpha4.snapshot2-java spec/api/lib/api/plugins_spec.rb