Files
computer-playbook/tests/unit/python/utils/install/test_ruby.py
T
kevinveenbirkenbach 3222904232 fix(test): install php and ruby instead of skipping their suites
test-unit-php and test-unit-ruby exited 0 whenever the interpreter or the
vendor tree was missing, so both suites were silently absent from every
gate. They now provision their toolchain through install-php/install-ruby
and fail loudly when that is impossible.

The three ensure_*_present helpers collapse into ensure_command_present
in system_pkg, and the ruby runner rejects an empty suite because
minitest reports success when nothing was required.
2026-08-22 20:30:40 +02:00

29 lines
807 B
Python

"""Unit tests for :mod:`utils.install.ruby`."""
from __future__ import annotations
import unittest
import unittest.mock as mock
from utils.install import ruby as ruby_mod
class TestEnsureRubyPresent(unittest.TestCase):
def test_delegates_to_the_shared_provisioner(self) -> None:
with mock.patch.object(ruby_mod, "ensure_command_present") as ensure:
ruby_mod.ensure_ruby_present()
ensure.assert_called_once_with("ruby")
def test_propagates_the_hard_failure(self) -> None:
with (
mock.patch.object(
ruby_mod, "ensure_command_present", side_effect=RuntimeError("boom")
),
self.assertRaises(RuntimeError),
):
ruby_mod.ensure_ruby_present()
if __name__ == "__main__":
unittest.main()