Sha256: 7f081e7f76986e9fd0bc1f0b0f8b6f17e7cb94a148ba077517868fde9b16bece

Contents?: true

Size: 1.29 KB

Versions: 4949

Compression:

Stored size: 1.29 KB

Contents

# frozen_string_literal: true
require 'spec_helper'

describe Ethon::Easy::Mirror do
  let(:options) { nil }
  let(:mirror) { described_class.new(options) }

  describe "::INFORMATIONS_TO_LOG" do
    [
      :return_code, :response_code, :response_body, :response_headers,
      :total_time, :starttransfer_time, :appconnect_time,
      :pretransfer_time, :connect_time, :namelookup_time, :redirect_time,
      :size_upload, :size_download, :speed_upload, :speed_upload,
      :effective_url, :primary_ip, :redirect_count, :redirect_url, :debug_info
    ].each do |name|
      it "contains #{name}" do
        expect(described_class::INFORMATIONS_TO_MIRROR).to include(name)
      end
    end
  end

  describe "#to_hash" do
    let(:options) { {:return_code => 1} }

    it "returns mirror as hash" do
      expect(mirror.to_hash).to eq(options)
    end
  end

  describe "#log_informations" do
    let(:options) { {:return_code => 1} }

    it "returns hash" do
      expect(mirror.log_informations).to be_a(Hash)
    end

    it "only calls methods that exist" do
      described_class::INFORMATIONS_TO_LOG.each do |method_name|
        expect(mirror.respond_to? method_name).to eql(true)
      end
    end

    it "includes return code" do
      expect(mirror.log_informations).to include(options)
    end
  end
end

Version data entries

4,949 entries across 4,949 versions & 19 rubygems

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