Sha256: 7ba68c210061367a7284835f293fadff884d4e43bfcf67c52f15e1f005189bfa

Contents?: true

Size: 1.37 KB

Versions: 40

Compression:

Stored size: 1.37 KB

Contents

require "spec_helper"

describe Manticore::Facade do
  context "when extended into an arbitrary class" do
    let(:extended_class) {
      Class.new do
        include Manticore::Facade
        include_http_client
      end
    }

    let(:extended_shared_class) {
      Class.new do
        include Manticore::Facade
        include_http_client shared_pool: true
      end
    }

    it "gets a response" do
      result = JSON.parse extended_class.get(local_server).body
      expect(result["method"]).to eq "GET"
    end

    it "does not use the shared client by default" do
      expect(extended_class.send(:__manticore_facade).object_id).to_not eq \
                                                                          Manticore.send(:__manticore_facade).object_id
    end

    it "is able to use the shared client" do
      expect(extended_shared_class.send(:__manticore_facade).object_id).to eq \
                                                                             Manticore.send(:__manticore_facade).object_id
    end

    it "should work with #http" do
      result = JSON.parse extended_class.http(:get, local_server).body
      expect(result["method"]).to eq "GET"
    end
  end

  context "from the default Manticore module" do
    it "gets a response" do
      result = JSON.parse Manticore.get(local_server).body
      expect(result["method"]).to eq "GET"
    end
  end
end

Version data entries

40 entries across 40 versions & 5 rubygems

Version Path
manticore-0.9.1-java spec/manticore/facade_spec.rb
manticore-0.9.0-java spec/manticore/facade_spec.rb
manticore-0.8.0-java spec/manticore/facade_spec.rb
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.7.1-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/manticore-0.7.1-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.7.1-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.7.1-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.7.1-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.7.1-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.7.1-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.7.1-java/spec/manticore/facade_spec.rb
manticore-0.7.1-java spec/manticore/facade_spec.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.6.4-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.6.4-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.6.4-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.6.4-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.6.4-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.6.4-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.6.4-java/spec/manticore/facade_spec.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/manticore-0.6.4-java/spec/manticore/facade_spec.rb