Sha256: 5d7adc0af46f587a49334e2759c43926ea1a04c8444cdce98422960cba7f0162

Contents?: true

Size: 989 Bytes

Versions: 15

Compression:

Stored size: 989 Bytes

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'

class TestRequest < Mushikago::Http::GetRequest
  include Mushikago::Auth::Signature
end


describe Mushikago::Http::Client do
  context 'construct without options' do
    before :all do
      @client = Mushikago::Http::Client.new
    end

    subject{ @client }

    its(:api_key){ should == Mushikago.config.api_key.to_s }
  end

  context 'construct with options' do
    before :all do
      @client = Mushikago::Http::Client.new(
        :api_key => 'mushikago api key'
      )
    end

    subject{ @client }

    its(:api_key){ should == 'mushikago api key' }
  end

  context 'send test request' do
    before :all do
      request = TestRequest.new
      request.host = 'api.mushikago.org'
      request.port = 443
      request.path = '/1/health/check'
      client = Mushikago::Http::Client.new
      @response = client.send_request(request)
    end
    subject{ @response }
    it{ should respond_to(:meta, :response) }
  end
end

Version data entries

15 entries across 12 versions & 1 rubygems

Version Path
mushikago-sdk-2.4.3 spec/mushikago/http/client_spec.rb
mushikago-sdk-2.4.3 spec//mushikago/http/client_spec.rb
mushikago-sdk-2.4.2 spec/mushikago/http/client_spec.rb
mushikago-sdk-2.4.2 spec//mushikago/http/client_spec.rb
mushikago-sdk-2.4.1 spec/mushikago/http/client_spec.rb
mushikago-sdk-2.4 spec/mushikago/http/client_spec.rb
mushikago-sdk-2.2 spec//mushikago/http/client_spec.rb
mushikago-sdk-2.2 spec/mushikago/http/client_spec.rb
mushikago-sdk-2.1.1 spec/mushikago/http/client_spec.rb
mushikago-sdk-2.1.0 spec/mushikago/http/client_spec.rb
mushikago-sdk-2.0.0 spec/mushikago/http/client_spec.rb
mushikago-sdk-0.4.3 spec/mushikago/http/client_spec.rb
mushikago-sdk-0.4.2 spec/mushikago/http/client_spec.rb
mushikago-sdk-0.4.1 spec/mushikago/http/client_spec.rb
mushikago-sdk-0.4.0 spec/mushikago/http/client_spec.rb