Skip to content
CAI
Software that uses CAICheck a score

mizzy/serverspec

63.7

Adequate · 19 September 2026

1.8k

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a Ruby library for server infrastructure testing that uses RSpec-style assertions to verify the state of remote hosts. It supports multiple operating systems, including Windows, Linux distributions, and Unix variants, by leveraging backends like SSH, WinRM, and local execution. The library provides a comprehensive set of matchers to check resources such as services, packages, files, network ports, and system configurations, ensuring consistent validation across diverse environments.

How it got here

2013 — Windows support and v2 refactoring

9 changes.

This period marked the initial release of Serverspec with explicit Windows support via WinRM and the introduction of CI integration. The codebase underwent significant structural refactoring to align with RSpec 3, including the removal of legacy matchers and the implementation of a centralized command and type system inherited from Specinfra.

2014 — comprehensive test coverage expansion

18 changes.

This period focused on significantly expanding test coverage across a wide array of operating systems, including Linux distributions, BSD variants, Solaris, AIX, Darwin, and Windows. The work involved adding comprehensive spec tests for system resources such as files, packages, services, and network ports to ensure correct behavior on each platform. Additionally, the underlying matcher library was refactored to support a chainable DSL, enabling more precise and context-aware assertions for resource properties.

Features

Initial release of Serverspec with Windows support and CI integration

This entry marks the initial commit of the Serverspec project, introducing RSpec-based server testing capabilities. It adds explicit support for Microsoft Windows via a new \:cmd\ and \:winrm\ backend, documented in \WINDOWS\_SUPPORT.md\ with examples for services, packages, and IIS. The project structure includes a Guardfile for test automation, a Rakefile for running specs across OS types, and CI configurations for Appveyor (Windows) and Wercker, alongside an integration-test submodule.

(repo-wide) · high confidence

Introduce Serverspec::Commands::Base class

A new base command class, Serverspec::Commands::Base, has been added to inherit from Specinfra::Command::Base. This establishes the foundational command structure for the Serverspec library, allowing platform-specific command implementations to extend this base class for consistent behavior.

lib/serverspec/commands · high confidence

Serverspec 2.43.0 release with refactored initialization and new matchers

This release bumps the version to 2.43.0 and introduces significant structural changes to the library. The \serverspec-init\ command has been rewritten to support interactive OS selection (Unix/Windows) and backend configuration (SSH, Exec, WinRM, Cmd), generating OS-specific sample specs (e.g., Apache on RedHat vs. Ubuntu) and a new \.rspec\ file. The matcher loading mechanism has been reorganized into a central \matcher.rb\ file, adding support for new matchers such as \be\_mounted\, \be\_readable\, \be\_writable\, \be\_executable\, \be\_resolvable\, \be\_reachable\, \belong\_to\_group\, \belong\_to\_primary\_group\, \have\_rule\ (for iptables/ipfilter), \have\_entry\ (for cron/fstab), and Windows-specific matchers like \have\_site\_application\. Additionally, a new \power\_assert.rb\ file introduces \Serverspec::TestCase\ for test-unit compatibility, and the \helper.rb\ now extends RSpec examples with type helpers.

lib/serverspec · high confidence

Removals

Removal of legacy RSpec matchers

The \be\_enabled\, \be\_file\, \be\_installed\, \be\_listening\, \be\_running\, and \contain\ matchers have been removed from the library. Users relying on these specific assertions for checking service states, file existence, package installation, network ports, process status, or file content will need to migrate to the updated matcher implementations provided in the current version.

lib/serverspec/matchers · high confidence

Behavioural changes

Consolidated resource type loader

The library now uses a centralized helper module to automatically load and register all supported resource types (such as file, service, package, and various OS-specific types) from a single list, simplifying the addition of new types and ensuring consistent availability across tests.

lib/serverspec/helper · high confidence

Improved failure output and RSpec 3 compatibility

The library now displays the target host name in test failure messages, enhancing debugging clarity. It also adds compatibility with RSpec 3.3.x and 3.4.0 by overriding failure line presentation methods, ensuring correct error reporting. Additionally, the library now requires 'rspec/its' and 'specinfra', and includes Specinfra's helper set, shifting backend logic to the Specinfra gem.

lib · high confidence

Introduce explicit subject types for resource matchers

Serverspec now uses explicit subject types (e.g., \Serverspec::Type::File\, \Serverspec::Type::Service\) for all resource matchers, replacing the previous implicit approach. This change provides a consistent base class (\Serverspec::Type::Base\) and ensures that matchers operate on clearly defined resource objects, improving readability and maintainability of test specifications.

lib/serverspec/type · high confidence

Refactor server resource matchers to support chained options

The matchers in lib/serverspec/matcher have been refactored to use a chainable DSL pattern, allowing users to specify additional context for assertions. For example, service checks like be\_enabled and be\_running now support an .under chain to specify the init system, while be\_installed supports .by and .with\_version to target specific package providers and versions. File permission matchers (be\_executable, be\_readable, be\_writable) now accept .by and .by\_user chains to distinguish between user and group permissions. Network matchers like be\_listening and be\_reachable support .with and .on chains for protocol and address details. New matchers have been added for SELinux state (be\_enforcing, be\_permissive with .with\_policy), IIS website properties (have\_site\_application, have\_site\_bindings, have\_virtual\_dir), and content matching (contain with .from/.to/.after/.before).

lib/serverspec/matcher · high confidence

Test coverage

Added AIX system resource tests; Added OpenBSD resource specs; Added Windows resource test coverage; Added base OS spec tests for system resources; Added regression test for String extension; Added server tests for FreeBSD file, package, port, and service types; Added service verification tests for Fedora 15 and 20; Added spec helper with mock backends for testing; Added test coverage for Arch Linux file, package, and service types; Added test coverage for Darwin and Ubuntu system types; Added test coverage for Debian package and service types; Added test coverage for Red Hat system resources; Added test coverage for Solaris 10 resource types; Added test coverage for Solaris resource types; Added test coverage for new Linux resource types; Added tests for FreeBSD 10 package verification; Added tests for OpenSUSE service state assertions; Added tests for SmartOS package and service types.

Dependencies

Update runtime dependencies and restrict net-ssh for older Ruby versions

The gem now requires RSpec 3.0, rspec-its, multi\_json, and specinfra (\~\> 2.72) as runtime dependencies, replacing previous development-only constraints. For users running Ruby versions older than 2.0.0, the Gemfile explicitly pins net-ssh to version 2.7 to ensure compatibility, as newer net-ssh versions dropped support for these older Ruby releases.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 64.

Lenses

  • Code Health 98
  • Architecture 100
  • Maturity 58
  • Readiness 47
  • Security 100

Changes since last survey

  • 300 commits — 277 feature/other, 23 fixes

By area

  • lib/serverspec — 119 commits
  • (repo) — 88 commits
  • (root) — 77 commits
  • spec/type — 9 commits
  • lib/serverspec.rb — 4 commits
  • .github/workflows — 2 commits
  • .github/stale.yml — 1 commit

Notable commits

  • fix: Fix
  • fix: Fix badges
  • fix: Fix badges
  • fix: Fix be_installed matcher when used with expect
  • fix: Fix infinite loop Specinfra::Configuration.os fallback
  • fix: Fix service is_enabled test when using under()
  • fix: Fix travis badge
  • fix: Fix x509 date parser
  • fix: Fixed be_mode test for AIX as it no longer raises an 'unimplemented' execption
  • fix: Fixed infinite loop in subject of x509_certificate
  • fix: Fixed x509_certificate test for openssl < 1.1
  • fix: Merge pull request #531 from pstengel/bugfix/docker-running
  • fix: Merge pull request #583 from jedipi/bugfix/incorrect-docker-inspect-indexing
  • fix: Merge pull request #589 from prehor/fix/critical_subject_alt_names
  • fix: Merge pull request #593 from prehor/fix/pkcs8-encrypted-private-key
  • fix: Merge pull request #596 from prehor/fix/x509-certificate-openssl-1.1
  • fix: Merge pull request #597 from m-ueno/fix-infinite-loop
  • fix: Merge pull request #598 from benningm/bug-be-installed-matcher-expect-syntax
  • fix: Merge pull request #615 from minimum2scp/fix/x509_certificate_subject_infinite_loop
  • fix: Revert "Update subproject"
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

mizzy/serverspec was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 4950dba20813f6890b7c89f7cab3c319af626307 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.