I have an environment built by using puppet. I was planning to write some rspec-ruby script that can be executed once the puppet build is complete to test whether all the directories, packages, users and roles are created.
What I would like is to test using rspec whether the particular version of Java and Tomcat (ex for tomcat: 9.0.17) is installed during the puppet build.
What I was doing so far was to test whether the directory is present for tomcat or java by including their version number in the directory name as well like the following:
describe file('/opt/tomcat/9.0.17') do
it { should be_directory }
end
Is there any other way apart from this? Or like the way we test for the package installation?