module-puppetlabs-apt/manifests
Reid Vandewiele d4fec561f3 Modify apt::source release parameter test
This commit modifies the release parameter test in apt::source to work
correctly within puppet-rspec for edge-case resource definitions. Previously,
the test for the $release parameter was written as

`if ! $release { fail() }`

This commit updates the test to be written as

`if $release == undef { fail() }`

Additionally, the tests for correct behavior in the presence or absence of a
$release parameter have been beefed up.

The reason for making this change relates to examples such as the following
resource definition:

apt::source { "jenkins":
  location    => "http://pkg.jenkins-ci.org/debian",
  release     => "",
  repos       => "binary/",
  key         => "D50582E6",
  key_source  => "http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key",
  include_src => false,
}

Note that the $release parameter is given as the empty string. In practice,
this is perfectly valid and everything will work great. However, it seems that
the empty string gets interpreted by something in puppet-rspec as something
equivalent to "False", and thus when testing, the above resource definition
would fail with "Puppet::Error: lsbdistcodename fact not available: release
parameter required" even though the $release parameter has been explicitely
specified (as the empty string).

See also: https://github.com/rtyler/puppet-jenkins/issues/9
2012-03-07 10:10:46 -08:00
..
debian (#12094) Replace chained .with_* with a hash 2012-02-08 09:24:43 -08:00
builddep.pp (#8720) Replace Apt::Ppa with Apt::Builddep 2011-08-02 15:12:34 -07:00
force.pp (#11953) Apt::force passes $version to aptitude 2012-01-13 15:29:47 -08:00
init.pp Merge pull request #23 from haus/python_properties 2012-02-24 11:20:52 -08:00
key.pp (#12823) Add apt::key defined type and modify apt::source to use it 2012-03-01 14:15:52 -08:00
params.pp (#12809) $release should use $lsbdistcodename and fall back to manual input 2012-03-01 11:15:02 -08:00
pin.pp (#12094) Replace name with path in file resources 2012-01-23 13:25:52 -08:00
ppa.pp (#12809) $release should use $lsbdistcodename and fall back to manual input 2012-03-01 11:15:02 -08:00
release.pp reformatted whitespace to match recommended style 2011-05-30 10:25:11 -07:00
source.pp Modify apt::source release parameter test 2012-03-07 10:10:46 -08:00