Skip to content

Instantly share code, notes, and snippets.

@JayH5
Created March 3, 2016 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JayH5/d85033f864e20ede0882 to your computer and use it in GitHub Desktop.
Save JayH5/d85033f864e20ede0882 to your computer and use it in GitHub Desktop.
Test for Puppet version-specific behaviour.
context 'Mesos package --no-install-recommends' do
let(:params) do
{
:controller_addrs => ['192.168.0.2'],
:advertise_addr => '192.168.0.2',
}
end
if Gem::Specification.find_by_name('puppet').version >=
Gem::Version.new('3.6.0')
it do
is_expected.to contain_package('mesos')
.with_install_options('--no-install-recommends')
end
it do
is_expected.not_to contain_service('zookeeper')
end
else
it do
is_expected.to contain_package('mesos')
.without_install_options('--no-install-recommends')
end
it do
is_expected.to contain_service('zookeeper')
.with_ensure('stopped')
.with_enable(false)
.that_requires('Package[mesos]')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment