mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
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.
29 lines
807 B
Python
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()
|