Sha256: 0a4f80efa3dacacf8bf3c0e3e9654fa594a612dd45d808b33a2e2e3d1cbcb9b5

Contents?: true

Size: 940 Bytes

Versions: 7

Compression:

Stored size: 940 Bytes

Contents

require 'spec_helper'
require 'berkshelf/api/rest_gateway'

module Berkshelf
  module API
    describe RESTGateway do
      let(:options) { {} }
      subject { described_class.new(options) }

      describe '.new' do
        context 'when given a different port' do
          before do
            options[:port] = 26210
          end

          it 'uses the correct port' do
            expect(subject.port).to eq(26210)
          end
        end
      end

      describe '#host' do
        it 'has the default value' do
          expect(subject.host).to eq(described_class::DEFAULT_OPTIONS[:host])
        end
      end

      describe '#port' do
        it 'has the default value' do
          expect(subject.port).to eq(described_class::DEFAULT_OPTIONS[:port])
        end
      end

      describe '#app' do
        it 'has the default value' do
          expect(subject.app).to be_a(RackApp)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
berkshelf-api-3.0.0 spec/unit/berkshelf/api/rest_gateway_spec.rb
berkshelf-api-2.2.0 spec/unit/berkshelf/api/rest_gateway_spec.rb
berkshelf-api-2.1.3 spec/unit/berkshelf/api/rest_gateway_spec.rb
berkshelf-api-2.1.2 spec/unit/berkshelf/api/rest_gateway_spec.rb
berkshelf-api-2.1.1 spec/unit/berkshelf/api/rest_gateway_spec.rb
berkshelf-api-2.1.0 spec/unit/berkshelf/api/rest_gateway_spec.rb
berkshelf-api-2.0.0 spec/unit/berkshelf/api/rest_gateway_spec.rb