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.4.6 spec/secrets_spec.rb
gris-0.4.5 spec/secrets_spec.rb