Sha256: 1601f4a4acc00252de56adc20f6cd2405440fccc46dd168c1df3967ff7825be2

Contents?: true

Size: 1 KB

Versions: 6758

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,758 entries across 6,756 versions & 22 rubygems

Version Path
cybrid_api_bank_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_id_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_organization_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_bank_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_id_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_organization_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_bank_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_organization_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_id_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
ory-client-1.16.2 vendor/bundle/ruby/3.1.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
talon_one-7.0.0 .github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_bank_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_organization_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_id_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_bank_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_id_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_organization_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
ory-client-1.16.1 vendor/bundle/ruby/3.1.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
ory-client-1.16.0 vendor/bundle/ruby/3.1.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb
cybrid_api_bank_ruby-0.123.143 vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb