Sha256: e5efa4b7d759390ee5b2751a119058f157c89fff8a10482f63326cfff88e6b11

Contents?: true

Size: 831 Bytes

Versions: 1

Compression:

Stored size: 831 Bytes

Contents

# frozen_string_literal: true

describe Sinclair::Configurable do
  describe '#yard' do
    before do
      MyConfigurable.configure do
        host 'interstella.com'
        port 5555
      end
    end

    after do
      MyConfigurable.reset_config
    end

    it 'sets right value for config host' do
      expect(MyConfigurable.config.host)
        .to eq('interstella.com')
    end

    it 'sets right value for config port' do
      expect(MyConfigurable.config.port)
        .to eq(5555)
    end

    context 'when reset_config is called' do
      before { MyConfigurable.reset_config }

      it 'returns initial value for host' do
        expect(MyConfigurable.config.host).to be_nil
      end

      it 'returns initial value for port' do
        expect(MyConfigurable.config.port).to eq(80)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sinclair-1.3.2 spec/integration/yard/sinclair/configurable_spec.rb