Sha256: ce68d3863eac1b2d578104d79c4fbb02d75e6e4f38c5efbf4ac0c02c47071365

Contents?: true

Size: 631 Bytes

Versions: 25

Compression:

Stored size: 631 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Sinclair::Options do
  describe 'readme' do
    it 'creates options object' do
      options = ConnectionOptions.new(
        timeout: 10,
        protocol: 'http'
      )

      expect(options.timeout).to eq(10)
      expect(options.retries).to eq(nil)
      expect(options.protocol).to eq('http')
      expect(options.port).to eq(443)
    end

    context 'when initialized with invalid options' do
      it do
        expect do
          ConnectionOptions.new(invalid: 10)
        end.to raise_error(Sinclair::Exception::InvalidOptions)
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
sinclair-2.1.1 spec/integration/readme/sinclair/options_spec.rb
sinclair-2.1.0 spec/integration/readme/sinclair/options_spec.rb
sinclair-2.0.1 spec/integration/readme/sinclair/options_spec.rb
sinclair-2.0.0 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.16.3 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.16.2 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.16.1 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.16.0 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.15.0 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.14.2 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.14.1 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.14.0 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.13.0 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.12.1 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.12.0 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.11.0 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.10.0 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.9.0 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.8.0 spec/integration/readme/sinclair/options_spec.rb
sinclair-1.7.0 spec/integration/readme/sinclair/options_spec.rb