Merge pull request #716 from EmersonPrado/MODULES-4377
authorTP Honey <tphoney@users.noreply.github.com>
Fri, 7 Jul 2017 17:00:08 +0000 (18:00 +0100)
committerGitHub <noreply@github.com>
Fri, 7 Jul 2017 17:00:08 +0000 (18:00 +0100)
(Modules 4377) Causes ensure_packages to accept concurrent declarations with ensure => 'present' and 'installed'

1  2 
lib/puppet/parser/functions/ensure_packages.rb
spec/functions/ensure_packages_spec.rb

@@@ -50,10 -40,17 +50,22 @@@ describe 'ensure_packages' d
      # this lambda is required due to strangeness within rspec-puppet's expectation handling
      it { expect(lambda { catalogue }).to contain_package('foo').with({'provider' => 'rpm', 'ensure' => 'present'}) }
      it { expect(lambda { catalogue }).to contain_package('bar').with({'provider' => 'gem', 'ensure' => 'present'}) }
 +
 +    context 'should run with UTF8 and double byte characters' do
 +    it { expect(lambda { catalogue }).to contain_package('パッケージ').with({'ensure' => 'absent'}) }
 +    it { expect(lambda { catalogue }).to contain_package('ρǻ¢κầģẻ').with({'ensure' => 'absent'}) }
 +    end
    end
+   context 'given a catalog with "package { puppet: ensure => present }"' do
+     let(:pre_condition) { 'package { puppet: ensure => present }' }
+     describe 'after running ensure_package("puppet", { "ensure" => "installed" })' do
+       before { subject.call(['puppet', { "ensure" => "installed" }]) }
+       # this lambda is required due to strangeness within rspec-puppet's expectation handling
+       it { expect(lambda { catalogue }).to contain_package('puppet').with_ensure('present') }
+     end
+   end
  end