Sha256: 1601f4a4acc00252de56adc20f6cd2405440fccc46dd168c1df3967ff7825be2

Contents?: true

Size: 1 KB

Versions: 6803

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true
require 'spec_helper'

describe Ethon::Curl do
  describe ".init" do
    before { Ethon::Curl.send(:class_variable_set, :@@initialized, false) }

    context "when global_init fails" do
      it "raises global init error" do
        expect(Ethon::Curl).to receive(:global_init).and_return(1)
        expect{ Ethon::Curl.init }.to raise_error(Ethon::Errors::GlobalInit)
      end
    end

    context "when global_init works" do
      before { expect(Ethon::Curl).to receive(:global_init).and_return(0) }

      it "doesn't raises global init error" do
        expect{ Ethon::Curl.init }.to_not raise_error
      end

      it "logs" do
        expect(Ethon.logger).to receive(:debug)
        Ethon::Curl.init
      end
    end

    context "when global_cleanup is called" do
      before { expect(Ethon::Curl).to receive(:global_cleanup) }

      it "logs" do
        expect(Ethon.logger).to receive(:debug).twice
        Ethon::Curl.init
        Ethon::Curl.cleanup
      end
    end
  end
end

Version data entries

6,803 entries across 6,801 versions & 23 rubygems

Version Path
cybrid_api_bank_ruby-0.1.2 vendor/bundle/ruby/3.1.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
cybrid_api_id_ruby-0.1.2 vendor/bundle/ruby/3.1.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
cybrid_api_organization_ruby-0.1.2 vendor/bundle/ruby/3.1.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
cybrid_api_bank_ruby-0.1.0 vendor/bundle/ruby/3.1.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
cybrid_api_organization_ruby-0.1.0 vendor/bundle/ruby/3.1.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
cybrid_api_id_ruby-0.1.0 vendor/bundle/ruby/3.1.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
cybrid_api_bank_ruby-0.0.36 vendor/bundle/ruby/3.1.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
cybrid_api_id_ruby-0.0.36 vendor/bundle/ruby/3.1.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
cybrid_api_organization_ruby-0.0.36 vendor/bundle/ruby/3.1.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
cybrid_api_bank_ruby-0.0.35 vendor/bundle/ruby/3.1.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
cybrid_api_id_ruby-0.0.35 vendor/bundle/ruby/3.1.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
cybrid_api_organization_ruby-0.0.35 vendor/bundle/ruby/3.1.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
ory-client-0.0.1.alpha169 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
ory-client-0.0.1.alpha168 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
ory-client-0.0.1.alpha167 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
ory-client-0.0.1.alpha166 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
ory-client-0.0.1.alpha165 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
ory-oathkeeper-client-0.38.25.beta1 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
ory-client-0.0.1.alpha164 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb
ory-client-0.0.1.alpha163 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb