Sha256: f394f437b819cb597b4087726ff3bd52534c399ed224434185febacccd6a3ba2

Contents?: true

Size: 844 Bytes

Versions: 28

Compression:

Stored size: 844 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Sinclair::EnvSettable::Builder do
  subject(:settable) { Class.new }

  let(:username) { 'my_login' }
  let(:password) { Random.rand(10_000).to_s }

  let(:builder) do
    described_class.new(settable, prefix, :username, :password, host: 'my-host.com')
  end

  before { builder.build }

  context 'when not using prefix' do
    let(:prefix) { nil }

    let(:username_key) { 'USERNAME' }
    let(:password_key) { 'PASSWORD' }
    let(:host_key)     { 'HOST' }

    it_behaves_like 'settings reading from env'
  end

  context 'when defining a prefix' do
    let(:prefix)       { 'MY_APP' }
    let(:username_key) { 'MY_APP_USERNAME' }
    let(:password_key) { 'MY_APP_PASSWORD' }
    let(:host_key)     { 'MY_APP_HOST' }

    it_behaves_like 'settings reading from env'
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
sinclair-2.0.1 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-2.0.0 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.16.3 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.16.2 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.16.1 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.16.0 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.15.0 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.14.2 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.14.1 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.14.0 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.13.0 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.12.1 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.12.0 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.11.0 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.10.0 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.9.0 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.8.0 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.7.0 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.6.7 spec/lib/sinclair/env_settable/builder_spec.rb
sinclair-1.6.6 spec/lib/sinclair/env_settable/builder_spec.rb