From 652fe1e9e26a7230c222e81e2e36ecc381de290a Mon Sep 17 00:00:00 2001 From: Juan Pablo Date: Tue, 5 Dec 2023 15:35:49 +0000 Subject: [PATCH] Basic tests for the service --- spec/services/rb_workers_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 spec/services/rb_workers_spec.rb diff --git a/spec/services/rb_workers_spec.rb b/spec/services/rb_workers_spec.rb new file mode 100644 index 0000000..000e567 --- /dev/null +++ b/spec/services/rb_workers_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' +set :os, family: 'redhat', release: '9', arch: 'x86_64' + +service = 'rb-workers' + +service_status = command("systemctl is-enabled #{service}").stdout +service_status = service_status.strip + +if service_status == 'enabled' + describe "Checking #{service_status} service for #{service}..." do + describe service(service) do + it { should be_enabled } + it { should be_running } + end + end +end