Skip to content
CAI
Software that uses CAICheck a score

email-spec/email-spec

59.4

Weak · 20 September 2026

8.3k

lines of production code

JavaScript

with Ruby

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a Ruby gem that provides testing helpers and matchers for verifying email delivery and content within applications. It enables developers to assert on email recipients, subjects, bodies, and attachments using RSpec and Cucumber, while also offering generators to scaffold these tests. The library supports integration with ActionMailer and includes example applications for Rails and Sinatra to demonstrate its usage across different frameworks.

How it got here

2008 — v2.3.1 architecture and dependency modernization

5 changes.

This period focused on restructuring the library into a modular architecture with expanded matchers and Launchy integration. It also involved modernizing the project's dependency management through a formal gemspec, Appraisals for Rails 7.2–8.1, and updated test suites for RSpec compatibility.

2009–2010 — Rails 4 and RSpec 3 integration

8 changes.

This period focused on updating the library and its examples to support Rails 4 and RSpec 3.1, including new generators for Cucumber steps and updated step definitions. Comprehensive test coverage was added for these new environments, alongside regression tests for Sinatra and Rails 4 integrations.

2015–2026 — Rails 4 example and modern version support

4 changes.

This period focused on expanding the project's testing infrastructure by adding a complete Rails 4 example application with email and user registration features. It also introduced a streamlined setup script and extended Appraisal configurations to support testing against Rails 7.2, 8.0, and 8.1.

Features

Add Appraisals for Rails 7.2, 8.0, and 8.1 testing

The project now includes an Appraisals file that defines test environments for Rails 7.2, 8.0, and 8.1 using the actionmailer gem. This allows developers to verify compatibility with these specific Rails versions during development and CI, ensuring the gem works correctly across the supported modern Rails stack.

(repo-wide) · high confidence

Added Rails 4 example application

A new example application named \rails4\_root\ has been added to demonstrate email testing with Rails 4. This includes the full application structure (config, migrations, features) and Cucumber scenarios for user signup, email attachments, and delayed job processing.

examples · high confidence

Added Rails 4 example application with email and user registration features

The \examples/rails4\_root\ directory now contains a complete Rails 4 example application. This includes a \UserMailer\ that sends signup confirmations, newsletters, and emails with attachments, along with a \WelcomeController\ that handles user registration and triggers these emails. The app provides views for the signup form, confirmation page, and newsletter subscription, as well as Cucumber step definitions to test the user registration and email delivery workflow.

_email\_spec, examples/rails4\_root, examples/rails4\_root/features/step\definitions · high confidence

Automated environment setup script added

A new \bin/setup\ script has been introduced to streamline the initial project configuration. When executed, it automatically copies the sample Ruby version file to the active configuration, installs the Bundler gem, and runs dependency installation for the main project as well as specific example applications (Rails 4 and Sinatra).

bin · high confidence

New Rails generator for Cucumber email steps

A new Rails generator (\email\_spec:steps\) has been added to the library, allowing users to scaffold email testing steps into their Cucumber \features/step\_definitions\ directory. The generated \email\_steps.rb\ file provides a comprehensive suite of Gherkin steps for verifying email delivery, inspecting subjects and bodies (including multi-part HTML/text content), checking attachments, and validating headers like reply-to, all implemented using RSpec 3-style expectations.

lib/generators · high confidence

Behavioural changes

Disable delayed job execution in test environment

The test support configuration now explicitly sets \Delayed::Worker.delay\_jobs = false\, ensuring that background jobs are executed immediately during feature tests rather than being queued. This change, located in the \env\_ext.rb\ support file, prevents test flakiness and speeds up execution by removing the need to wait for asynchronous job processing.

_examples/rails4\root/features/support · high confidence

EmailSpec v2.3.1: New architecture with Launchy integration and expanded matchers

This release restructures the library into a modular architecture (deliveries, extractors, matchers, helpers) and upgrades the email viewing workflow to use Launchy for opening raw, HTML, and text emails. It introduces new test matchers for BCC and CC recipients (\bcc\_to\, \cc\_to\), reply-to addresses (\reply\_to\), and sender verification (\deliver\_from\), while adding helper methods like \last\_email\_sent\ and \last\_email\_address\. The gem also adds support for the Pony email library, integrates with ActionMailer's cache delivery method, and ensures compatibility with RSpec 3 and Rails 4.

_lib/email\spec · high confidence

Initialize Cucumber support environment with shared world object

A new support file (env.rb) has been added to configure the Cucumber test environment. It defines an EmailSpecWorld class that provides access to the project's root directory and registers this instance as a world object, making the root path available to all feature steps.

features/support · high confidence

Reworked library structure and added HTML entities dependency

The library's entry point has been consolidated into a single \email\_spec.rb\ file that explicitly requires \htmlentities\ and \mail\, ensuring these dependencies are available for email processing. This change replaces the previous multi-file setup (including \email\_spec\_feature\_setup.rb\, \email\_spec\_helpers.rb\, \email\_spec\_matchers.rb\, and \email\_spec\_steps.rb\) with a more modular internal structure, shifting how the gem loads its components and dependencies.

lib · high confidence

Updated Cucumber step definitions for Rails 4 and Bundler compatibility

The test suite's step definitions have been updated to support Rails 4 applications alongside existing Rails 3 setups. The new \app\_steps.rb\ file introduces logic to handle environment-specific bundler configurations, ensuring that tests run correctly within the context of each example app's Gemfile. It also distinguishes between Rails 4 (which uses the gem directly) and older versions (which use vendor plugins and generators), and replaces deprecated file existence checks with modern RSpec matchers.

_features/step\definitions · high confidence

Updated Sinatra example app test support for Capybara integration

The test support files for the Sinatra example application have been updated to properly configure the Cucumber environment. The setup now explicitly includes Capybara::DSL within a dedicated world class and assigns the ExampleSinatraApp instance to Capybara.app, ensuring correct integration for acceptance tests. Additionally, navigation helpers have been added to map page names to specific paths, enabling step definitions like 'When I go to the home page' to function correctly.

_examples/sinatra\root/features/support · high confidence

Updated Sinatra example to use RSpec 3.1 syntax

The step definitions in the Sinatra example have been rewritten to use the RSpec 3.1 \expect\ syntax instead of the older \.should\ style. This change ensures the example application's tests pass with the upgraded testing framework.

_examples/sinatra\_root/features/step\definitions · high confidence

Test coverage

Added regression tests for Rails 4 and Sinatra app integrations; Added test coverage for EmailSpec core components; Updated test suite for RSpec compatibility and improved helper configuration.

Dependencies

Add Appraisal configurations for Rails 7.2, 8.0, and 8.1

The gemfiles directory now includes new Appraisal configuration files for Rails 7.2, 8.0, and 8.1, enabling the library to be tested against these specific versions of ActionMailer. This expands the supported Rails versions for development and testing purposes.

gemfiles · high confidence

Initial gemspec and example application dependency manifests

The gem is now distributed with a formal \email\_spec.gemspec\ defining runtime dependencies on \htmlentities\ (\~\> 4.3), \launchy\ (\>= 2.1, \< 4.0), and \mail\ (\~\> 2.7), alongside development dependencies for \rspec\ (\~\> 3.1), \cucumber\ (\~\> 1.3.17), and others. A root \Gemfile\ is introduced to manage development tools like \appraisal\, \debug\, and \net-smtp\. Additionally, example applications for Rails 4.2.8 and Sinatra are provided with their own \Gemfile\s, wiring in \email\_spec\ via path reference to facilitate testing email functionality in these frameworks.

(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 59.

Lenses

  • Code Health 99
  • Architecture 99
  • Maturity 38
  • Readiness 58
  • Security 93
  • Domain Modelling 100

Changes since last survey

  • 300 commits — 267 feature/other, 33 fixes

By area

  • (root) — 117 commits
  • (repo) — 90 commits
  • lib/email_spec — 47 commits
  • examples/rails3_root — 14 commits
  • examples/rails4_root — 6 commits
  • spec/email_spec — 6 commits
  • .github/workflows — 3 commits
  • features/step_definitions — 3 commits
  • lib/generators — 3 commits
  • examples/sinatra_root — 2 commits
  • features/rails3_app.feature — 2 commits
  • features/rails4_app.feature — 2 commits
  • rails_generators/email_spec — 2 commits
  • spec/spec_helper.rb — 2 commits
  • lib/email_spec.rb — 1 commit

Notable commits

  • fix: Fix CC/BCC failing on nil .cc or .bbc values
  • fix: Fix Cucumber example in README
  • fix: Fix compatibility issue with Mail 2.7.0
  • fix: Fix email viewer for complex content types
  • fix: Fix minitest documentation
  • fix: Fix release date of 1.5.0
  • fix: Fix the issue that sometimes visit_in_email helper matches the wrong link [fixes #177]
  • fix: Fix unread emails helper for cached deliveries
  • fix: Fix viewing text emails in Rails 3
  • fix: Fixed default find_email
  • fix: Fixed helper_spec.rb
  • fix: Fixed warnings showing up because of Rails 4 upgrade.
  • fix: Fixes #172
  • fix: Make README a little clearer about how to receive emails for a particular address. Fixes #15.
  • fix: Merge branch 'master' into fixes-issue-57
  • fix: Merge pull request #135 from thomasfedb/fix-should-in-helper
  • fix: Merge pull request #167 from mauro-oto/fix-test-warnings-and-remove-unused-code
  • fix: Merge pull request #179 from email-spec/fixes-issue-28
  • fix: Merge pull request #180 from email-spec/fixes-issue-57
  • fix: Merge pull request #183 from email-spec/fixes/decode-default-part-body
  • …and 280 more

Architecture

  • 0 containers · 1 bounded contexts · 0 dependency edges (baseline)

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

Survey your own repository

email-spec/email-spec 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 20 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 d280ef5a418688f40a2593ae9ab071ac705f9368 — 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-b51f968c9b10.