Sha256: a2af21dae5ce70dc6e65815702059e2d9b21bf5e926f8bbfa3eb167ecd1d891e

Contents?: true

Size: 987 Bytes

Versions: 22

Compression:

Stored size: 987 Bytes

Contents

require 'spec_helper'

describe 'Gris.secrets' do
  context 'with a local yaml file' do
    include_context 'with secrets from config/secrets.yml'

    it 'sets the secret property corresponding to the current Gris.env' do
      expect(Gris.secrets.service_name).to eq 'my_test_app'
    end

    it 'sets the secret property corresponding to the default value' do
      expect(Gris.secrets.base_url).to eq 'https://www.youtube.com/watch?v=RI6973HNh8Y'
    end
  end

  context 'without a local yaml file' do
    [true, 1, 0, 'anystring'].each do |value|
      it "returns true when value is #{value.inspect}" do
        Gris.secrets.notifications_enabled = value
        expect(Gris.secrets.notifications_enabled?).to be_truthy
      end
    end

    [false, nil].each do |value|
      it "returns false when value is #{value.inspect}" do
        Gris.secrets.notifications_enabled = value
        expect(Gris.secrets.notifications_enabled?).to_not be_truthy
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
gris-0.6.8 spec/secrets_spec.rb
gris-0.6.7 spec/secrets_spec.rb
gris-0.6.6 spec/secrets_spec.rb
gris-0.6.5 spec/secrets_spec.rb
gris-0.6.2 spec/secrets_spec.rb
gris-0.6.1 spec/secrets_spec.rb
gris-0.6.0 spec/secrets_spec.rb
gris-0.5.9 spec/secrets_spec.rb
gris-0.5.8 spec/secrets_spec.rb
gris-0.5.7 spec/secrets_spec.rb
gris-0.5.6 spec/secrets_spec.rb
gris-0.5.5 spec/secrets_spec.rb
gris-0.5.4 spec/secrets_spec.rb
gris-0.5.3 spec/secrets_spec.rb
gris-0.5.2 spec/secrets_spec.rb
gris-0.5.1 spec/secrets_spec.rb
gris-0.5.0 spec/secrets_spec.rb
gris-0.4.9 spec/secrets_spec.rb
gris-0.4.8 spec/secrets_spec.rb
gris-0.4.7 spec/secrets_spec.rb