Sha256: af3aacba78772f6214b37cc72f8d83d8c5641e76d7a9c5f4c471b49c8b0c40eb

Contents?: true

Size: 981 Bytes

Versions: 8

Compression:

Stored size: 981 Bytes

Contents

require "spec_helper"

module Beaker
  module Options

    describe Presets do
      let(:presets)    { Presets.new }

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

      it "pulls in env vars of the form ':q_*' and adds them to the :answers of the OptionsHash" do
         ENV['q_puppet_cloud_install'] = 'n'
         env = presets.env_vars
         expect(env[:answers][:q_puppet_cloud_install]).to be === 'n'
         expect(env[:answers]['q_puppet_cloud_install']).to be === 'n'
         ENV.delete('q_puppet_cloud_install')
      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

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
beaker-2.26.0 spec/beaker/options/presets_spec.rb
beaker-2.25.0 spec/beaker/options/presets_spec.rb
beaker-2.24.0 spec/beaker/options/presets_spec.rb
beaker-2.23.0 spec/beaker/options/presets_spec.rb
beaker-2.22.0 spec/beaker/options/presets_spec.rb
beaker-2.21.0 spec/beaker/options/presets_spec.rb
beaker-2.20.0 spec/beaker/options/presets_spec.rb
beaker-2.19.0 spec/beaker/options/presets_spec.rb