EPEL only makes sense on RH systems but not Fedora#297
Conversation
|
+1 Though there should be a spec test that tests for the inclusion of the epel class based on the platform. The README should also be updated for the use_epel parameter. I'll look into the issue with ruby 1.8.7 failing. |
|
working in PR #298 to fix ruby 1.8.7 |
|
If you rebase off of master, it will pull in the changes necessary to get ruby 1.8.7 working for this PR. |
|
I have no idea how to test for the state of a variable withing a class. Any pointers? |
|
You are not testing for a variable, which cannot be done, instead you are testing that a resource is or is not included in the catalog. So the tests would look like it { should contain_class('epel') }and it { should_not contain_class('epel') } |
Conflicts: manifests/params.pp
| end | ||
|
|
||
| describe "EPEL need not apply" do | ||
| context "default/empty" do |
There was a problem hiding this comment.
need to set the facts with values for osfamily and operatingsystem. Will need three different tests to correspond with the code in params.
describe 'epel class' do
context 'when osfamily is RedHat and operatingsystem is Fedora' do
...
end
context 'when osfamily is RedHat and operatingsystem is Fedora' do
...
end
context 'when osfamily is RedHat and operatingsystem is not Fedora' do
...
end
context 'when osfamily is not RedHat' do
...
end
endto set the facts, it would look like this
context 'whatever' do
let(:facts) do
{
:osfamily => 'RedHat',
:operatingsystem => 'Fedora',
}
end…not RHEL, is Debian
|
In this last commit, I believe I've got the tests with the right facts set inserted along with their operating systems. |
|
Released in 1.18.1 |
* EPEL only makes sense on RH systems but not Fedora * Updated documentation, added test * updated tests: is RHEL has EPEL, is Fedora no EPEL, is RPM based but not RHEL, is Debian
This update to params.pp only sets EPEL true if it would make sense