awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectAboutHow we rankPressMCP server
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
rspec avatar

rspec/rspec-rails

0
View on GitHub↗
5,271 stars·1,047 forks·Ruby·MIT·10 viewsrspec.info↗

Rspec Rails

rspec-rails is a testing framework that integrates RSpec with Ruby on Rails to provide behavior-driven development tools. It serves as a suite for defining application behavior through a conversational syntax, providing a specialized toolkit for creating behavioral specifications for models, controllers, and views.

The project distinguishes itself through automated test generation, providing a command-line interface to create boilerplate specification files for Rails components such as models, controllers, and background jobs. It further differentiates its capabilities with a comprehensive mocking and stubbing library and a web application integration suite designed to simulate full request cycles and browser interactions.

The framework covers a broad surface of integration testing, including route mapping verification, mailer content validation, and background job execution. It provides a wide array of test assertions for validating object state, HTTP response statuses, and database query results, alongside tools for managing test doubles via spies and stubs.

The system includes a command-line executable for test execution and a persistent configuration store to standardize settings across environments.

Features

  • Behavioral Specifications - Implements a conversational BDD structure of examples and contexts to define application behavior.
  • Behavior Driven Development - Provides a framework for defining application behavior using a descriptive and conversational specification syntax.
  • CLI Execution - Provides a dedicated command-line executable to run the complete suite of behavioral specifications.
  • Method Stubbing - Implements method stubbing to define pre-determined return values or behaviors for objects during testing.
  • Dynamic Response Configurations - Allows defining return values using logic blocks to calculate results dynamically based on input.
  • Shared Test Contexts - Provides reusable blocks of setup and configuration shared across multiple test examples via metadata tags.
  • Dependency-Mocked Unit Testers - Isolates units of logic by replacing real system components with mocks, stubs, or spies.
  • Test Grouping Utilities - Organizes tests into nested groups to manage shared setup, teardown, and configuration inheritance.
  • Mocking and Spying Libraries - Ships a comprehensive suite for creating test doubles, mocks, and spies to isolate dependencies.
  • Request Cycle Testing - Validates the full request-response pipeline, including routing and middleware, by simulating HTTP requests.
  • Ruby on Rails Testing Frameworks - Integrates behavioral specifications with the Ruby on Rails framework to verify various application layers.
  • Shared Example Groups - Defines reusable sets of specifications and contexts that can be mixed into multiple test groups.
  • End-to-End Testing - Simulates complete user workflows across the entire application stack and browser to verify functional correctness.
  • Test Double Libraries - Provides a suite of test doubles, including mocks, stubs, and spies, to simulate external components.
  • Database Result Assertions - Provides assertions to verify that a database query returns the exact set of expected records.
  • Test Specification Templates - Creates boilerplate specification files by applying predefined templates to component names via a CLI.
  • Rails Component Generators - Automatically generates boilerplate specification files tailored to Rails models, controllers, and background jobs.
  • Test Execution Configurations - Manages test runner behavior through a command-line interface or a persistent configuration file.
  • Model Logic Testing - Includes frameworks and macros to verify the behavioral logic and data integrity of database-backed models.
  • Browser Interaction Testing - Simulates user browser interactions to verify high-level application functionality from an external perspective.
  • Controller Logic Testing - Simulates HTTP requests to controllers to verify rendered templates, redirects, and instance variables.
  • Test Metadata - Stores descriptive tags and location data for test groups to facilitate selective execution and reporting.
  • HTTP Response Assertions - Ships matchers to validate that HTTP responses return specific numeric status codes or categories.
  • Call Argument Matchers - Validates that methods are invoked with specific values using built-in or custom matching criteria.
  • Object Instrumentation - Adds mock behavior to existing real objects to intercept calls and return test data.
  • Rails Component Specifications - Provides specialized test configurations and helper modules tailored for Rails models, controllers, mailers, jobs, and views.
  • Class-Wide Stubbing - Applies stubs or expectations to every instance of a specific class for consistent behavior across tests.
  • Collection Membership Assertions - Includes assertions to verify that a collection contains specific items or matches another array exactly.
  • Exception Assertions - Verifies that a block of code raises a specific exception class or error message.
  • Mock Expectation Verifiers - Requires specific methods to be called before a test ends to ensure expected interactions occur.
  • Application Stack Flow Testing - Drives behavior through the entire application stack across multiple requests and sessions.
  • View Template Rendering Tests - Provides tools to verify that view templates render the correct content by simulating controller and path contexts.
  • Component-Specific Test Helpers - Loads specialized support functions and helper modules based on the type of Rails component being tested.
  • State Assertions - Compares objects for identity, equivalence, or type membership to ensure they match expected values.
  • Template Rendering Assertions - Verifies that a specific request results in the rendering of the intended view template or layout.
  • Test Boilerplate Generators - Automatically creates skeleton specification files for Rails components such as models and controllers.
  • Test Execution Filtering - Allows selective execution of test subsets based on descriptive tags and properties.
  • Interaction Spies - Records calls to an object and verifies they occurred after the fact using interaction spies.
  • Nested Setup Nodes - Provides hierarchical initialization structures through nested blocks to refine the test environment in a BDD tree.
  • Ruby Frameworks and Tools - RSpec testing framework for Rails.
  • Testing - Testing framework for Rails.
  • More to explore - Provides a testing framework.

Star history

Star history chart for rspec/rspec-railsStar history chart for rspec/rspec-rails

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does rspec/rspec-rails do?

rspec-rails is a testing framework that integrates RSpec with Ruby on Rails to provide behavior-driven development tools. It serves as a suite for defining application behavior through a conversational syntax, providing a specialized toolkit for creating behavioral specifications for models, controllers, and views.

What are the main features of rspec/rspec-rails?

The main features of rspec/rspec-rails are: Behavioral Specifications, Behavior Driven Development, CLI Execution, Method Stubbing, Dynamic Response Configurations, Shared Test Contexts, Dependency-Mocked Unit Testers, Test Grouping Utilities.

What are some open-source alternatives to rspec/rspec-rails?

Open-source alternatives to rspec/rspec-rails include: codeception/codeception — Codeception is a full-stack testing framework for PHP applications that provides a unified interface for unit,… rspec/rspec-mocks — This project is a Ruby unit testing tool designed for dependency isolation and behavioral contract verification. It… thomhurst/tunit — TUnit is a comprehensive C# testing framework, mocking library, and fluent assertion tool. It utilizes source… doctest/doctest — doctest is a lightweight C++ unit testing framework and assertion library. It provides a single-header implementation… onsi/ginkgo — Ginkgo is a behavior-driven development testing framework, assertion library, and test runner for Go. It provides a… behat/behat — Behat is a behavior-driven development framework and test automation tool for PHP. It functions as a Gherkin test…

Open-source alternatives to Rspec Rails

Similar open-source projects, ranked by how many features they share with Rspec Rails.
  • codeception/codeceptionCodeception avatar

    Codeception/Codeception

    4,855View on GitHub↗

    Codeception is a full-stack testing framework for PHP applications that provides a unified interface for unit, functional, and acceptance testing. It serves as a tool for automating real desktop and mobile browsers via the WebDriver protocol and acts as a client for testing REST and SOAP APIs. The framework is distinguished by its support for Behavior-Driven Development, allowing users to write human-readable test specifications in Gherkin language to align technical tests with business requirements. It implements actor-based action mapping to connect these natural language steps to executabl

    PHP
    View on GitHub↗4,855
  • rspec/rspec-mocksrspec avatar

    rspec/rspec-mocks

    1,148View on GitHub↗

    This project is a Ruby unit testing tool designed for dependency isolation and behavioral contract verification. It functions as a comprehensive mocking framework that allows developers to replace real objects with controlled placeholders, ensuring that code interacts with its dependencies as expected during automated test execution. The framework distinguishes itself through its ability to perform partial double verification, which checks that stubbed methods exist on the underlying object to prevent tests from passing against incorrect interfaces. It also provides sophisticated constant man

    Rubyrspecruby
    View on GitHub↗1,148
  • thomhurst/tunitthomhurst avatar

    thomhurst/TUnit

    3,744View on GitHub↗

    TUnit is a comprehensive C# testing framework, mocking library, and fluent assertion tool. It utilizes source generation for test discovery and mock creation, ensuring compatibility with Native AOT and IL trimming by eliminating the need for runtime reflection and proxies. The framework provides specialized capabilities for integration testing, including the management of distributed application lifecycles, isolated database schemas, and the correlation of telemetry and logs across process boundaries via OTLP. It also includes an HTTP testing utility to intercept network exchanges and mock AP

    C#csharpdotnettest
    View on GitHub↗3,744
  • doctest/doctestdoctest avatar

    doctest/doctest

    6,765View on GitHub↗

    doctest is a lightweight C++ unit testing framework and assertion library. It provides a single-header implementation that eliminates complex build dependencies, allowing developers to write and execute test cases directly within their source code. The framework is distinguished by its focus on compile-time performance and binary overhead. It uses conditional compilation guards to strip all testing logic and metadata from production binaries. Additionally, it features hierarchical subcases that re-execute parent setup code to isolate different execution paths within a single test case. Its c

    C++c-plus-pluscppcpp11
    View on GitHub↗6,765
See all 30 alternatives to Rspec Rails→