Sha256: 10ce192bd1c245f13987c6f6198ed12e8ecf7ec075cf810f75e1d86253a3466c

Contents?: true

Size: 1.22 KB

Versions: 11

Compression:

Stored size: 1.22 KB

Contents

require "spec_helper"

module Beaker
  module Options

    describe Presets do
      let(:presets)    { Presets }

      it "returns an env_vars OptionsHash" do
        expect(presets.env_vars).to be_instance_of(Beaker::Options::OptionsHash)
      end

      it "removes all empty/nil entries in env_vars" do
        expect(presets.env_vars.has_value?(nil)).to be === false
        expect(presets.env_vars.has_value?({})).to be === false
      end

      it "returns a presets OptionsHash" do
        expect(presets.presets).to be_instance_of(Beaker::Options::OptionsHash)
      end

      describe 'when setting the type as pe from the environment' do
        describe 'sets type to pe if...' do
          it 'env var is set to "true"' do
            munged = presets.munge_found_env_vars :is_pe => 'true'
            expect( munged[:type] ).to be == 'pe'
          end
          it 'env var is set to "yes"' do
            munged = presets.munge_found_env_vars :is_pe => 'yes'
            expect( munged[:type] ).to be == 'pe'
          end
        end
        it 'does not set type otherwise' do
          munged = presets.munge_found_env_vars :is_pe => 'false'
          expect( munged[:type] ).to be == nil
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
beaker-1.19.1 spec/beaker/options/presets_spec.rb
beaker-1.19.0 spec/beaker/options/presets_spec.rb
beaker-1.18.0 spec/beaker/options/presets_spec.rb
beaker-1.17.7 spec/beaker/options/presets_spec.rb
beaker-1.17.6 spec/beaker/options/presets_spec.rb
beaker-1.17.5 spec/beaker/options/presets_spec.rb
beaker-1.17.4 spec/beaker/options/presets_spec.rb
beaker-1.17.3 spec/beaker/options/presets_spec.rb
beaker-1.17.2 spec/beaker/options/presets_spec.rb
beaker-1.17.1 spec/beaker/options/presets_spec.rb
beaker-1.17.0 spec/beaker/options/presets_spec.rb