email-spec/email-spec
61.3
Adequate · 6 November 2026
8.3k
lines of production code
JavaScript
with Ruby
4
measurements over time
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 cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 64 → 61 (-2.6)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 99 → 99 (+0.0)
- Architecture 99 → 99 (+0.0)
- Maturity 47 → 44 (-3.0)
- Readiness 62 → 62 (+0.1)
- Security 87 → 78 (-8.7)
- Domain Modelling 100 → 100 (+0.0)
Resolved (4)
- Documentation: no architecture or design documentation (README.md)
- Inconsistent naming for retrieving the most recent email. open_last_email and open_last_email_for imply fetching the last sent email, while open_email requires an address argument. It is unclear if open_email is meant to be a general lookup or if there is a missing open_last_email variant that doesn't take an address. The distinction between 'last' and general lookup is not explicit in the name open_email.
- Inconsistent return type implication. current_email likely returns the email object, while current_email_attachments returns a list of attachments. However, links_in_email(email) takes an email object and returns links. The naming convention current_* implies stateful retrieval (like a session), whereas links_in_email is a pure function on an argument. This mixes stateful and stateless patterns.
- Outdated: cucumber
Architecture
- Unchanged — 0 containers · 1 contexts · 0 edges
Written by cca.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 6 November 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.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.