Sha256: 8d02c05997ce610f24eb825ad6faf3b7b193096bfadfb38d862c04d4cd0ce564

Contents?: true

Size: 1.55 KB

Versions: 9

Compression:

Stored size: 1.55 KB

Contents

require 'spec_helper'

describe Minimart::Configuration do

  describe '#output' do
    subject { Minimart::Configuration.output }
    it { is_expected.to be_a Minimart::Output }
  end

  describe '#chef_server_config' do
    subject { Minimart::Configuration.chef_server_config }
    it { is_expected.to eq({ssl: {verify: true}}) }

    context 'when a value is set' do
      let(:conf) { {'client_name' => 'berkshelf', 'client_key' => 'key_path'} }

      before(:each) { Minimart::Configuration.chef_server_config = conf }
      after(:each) { Minimart::Configuration.chef_server_config = nil }

      it { is_expected.to include conf }
    end
  end

  describe '#github_config' do
    subject { Minimart::Configuration.github_config }
    it { is_expected.to eq({:connection_options=>{:ssl=>{:verify=>true}}}) }

    context 'when a value is set' do
      let(:conf) { {'organization' => 'org', 'api_endpoint' => 'api'} }

      before(:each) { Minimart::Configuration.github_config = conf }
      after(:each) { Minimart::Configuration.github_config = nil }

      it { is_expected.to include conf }
    end
  end

  describe '#verify_ssl' do
    after(:each) { Minimart::Configuration.verify_ssl = nil }

    subject { Minimart::Configuration.verify_ssl }
    it { is_expected.to eq true }

    context 'when set to false' do
      subject { Minimart::Configuration.verify_ssl = false }
      it { is_expected.to eq false }
    end

    context 'when set to true' do
      subject { Minimart::Configuration.verify_ssl = true }
      it { is_expected.to eq true }
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
minimart-1.2.5 spec/lib/minimart/configuration_spec.rb
minimart-1.2.4 spec/lib/minimart/configuration_spec.rb
minimart-1.2.3 spec/lib/minimart/configuration_spec.rb
minimart-1.2.0 spec/lib/minimart/configuration_spec.rb
minimart-1.1.6 spec/lib/minimart/configuration_spec.rb
minimart-1.1.3 spec/lib/minimart/configuration_spec.rb
minimart-1.0.2 spec/lib/minimart/configuration_spec.rb
minimart-1.0.1 spec/lib/minimart/configuration_spec.rb
minimart-0.0.1 spec/lib/minimart/configuration_spec.rb