Sha256: b95a793a86aaf3e8eea10a91f8a37e0b3e01c7f59262228d4da41bfa8b78d1c9

Contents?: true

Size: 993 Bytes

Versions: 20

Compression:

Stored size: 993 Bytes

Contents

require 'spec_helper'
describe 'apt::force', :type => :define do
  let :title do
    'my_package'
  end

  let :default_params do
    {
      :release => 'testing',
      :version => false
    }
  end

  [{},
   {
      :release  => 'stable',
      :version  => '1'
    }
  ].each do |param_set|
    describe "when #{param_set == {} ? "using default" : "specifying"} define parameters" do
      let :param_hash do
        default_params.merge(param_set)
      end

      let :params do
        param_set
      end

      let :unless_query do
        base_command = "/usr/bin/dpkg -s #{title} | grep -q "
        base_command + (params[:version] ? "'Version: #{params[:version]}'" : "'Status: install'")
      end

      let :exec_title do
        base_exec = "/usr/bin/apt-get -y -t #{param_hash[:release]} install #{title}"
        base_exec + (params[:version] ? "=#{params[:version]}" : "")
      end
      it { should contain_exec(exec_title).with_unless(unless_query) }
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
freighthop-0.6.1 modules/apt/spec/defines/force_spec.rb
freighthop-0.6.0 modules/apt/spec/defines/force_spec.rb
freighthop-0.5.2 modules/apt/spec/defines/force_spec.rb
freighthop-0.5.1 modules/apt/spec/defines/force_spec.rb
freighthop-0.5.0 modules/apt/spec/defines/force_spec.rb
freighthop-0.4.1 modules/apt/spec/defines/force_spec.rb
freighthop-0.4.0 modules/apt/spec/defines/force_spec.rb
freighthop-0.3.3 modules/apt/spec/defines/force_spec.rb
freighthop-0.3.2 modules/apt/spec/defines/force_spec.rb
freighthop-0.3.1 modules/apt/spec/defines/force_spec.rb
freighthop-0.3.0 modules/apt/spec/defines/force_spec.rb
freighthop-0.2.1 modules/apt/spec/defines/force_spec.rb
freighthop-0.2.0 modules/apt/spec/defines/force_spec.rb
freighthop-0.1.0 modules/apt/spec/defines/force_spec.rb
freighthop-0.0.6 modules/apt/spec/defines/force_spec.rb
freighthop-0.0.5 modules/apt/spec/defines/force_spec.rb
freighthop-0.0.4 modules/apt/spec/defines/force_spec.rb
freighthop-0.0.3 modules/apt/spec/defines/force_spec.rb
freighthop-0.0.2 modules/apt/spec/defines/force_spec.rb
freighthop-0.0.1 modules/apt/spec/defines/force_spec.rb