awesome-repositories.com
المدونة
awesome-repositories.com

اكتشف أفضل مستودعات المصادر المفتوحة باستخدام بحث مدعوم بالذكاء الاصطناعي.

استكشفعمليات بحث منسقةبدائل مفتوحة المصدربرمجيات ذاتية الاستضافةالمدونةخريطة الموقع
المشروعحولكيفية ترتيب النتائجالصحافةخادم MCP
قانونيالخصوصيةالشروط
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
rspec avatar

rspec/rspec-mocksArchived

0
View on GitHub↗
1,148 نجوم·352 تفرعات·Ruby·MIT·1 مشاهدةrspec.info↗

Rspec Mocks

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 management, enabling the temporary overriding, hiding, or stubbing of global constants to maintain environment consistency. Furthermore, the tool supports real object instrumentation and instance-level method injection, allowing for the modification of specific object behavior without affecting global class definitions.

Beyond these core capabilities, the library offers extensive utilities for interaction verification, including support for call ordering enforcement, interaction frequency control, and the implementation of test spies. It facilitates legacy codebase refactoring by allowing developers to apply expectations to existing classes and instances, and it includes mechanisms for creating null object doubles to simplify dependency management.

The framework provides command-line utilities for running test suites and generating reproducible scripts to assist in debugging. It also supports environment customization through supplemental configuration files, allowing for the injection of dependencies without altering the primary project architecture.

Features

  • Test Environment Mocks - Replaces real objects with test doubles to simulate dependencies and verify interactions without executing actual production logic.
  • Ruby Testing Frameworks - Provides a comprehensive framework for building and running test suites in Ruby applications.
  • Automated Test Execution - Provides command-line interfaces to run automated test suites and verify code behavior.
  • Method Stubbing - Replaces real method behavior with pre-determined return values on test doubles and existing objects to control dependencies.
  • Behavioral Contract Validation - Asserts that objects receive expected messages with specific arguments and frequencies to ensure code interacts correctly with its dependencies.
  • Interaction Expectations - Provides the primary mechanism for asserting that specific methods are called with expected arguments and frequencies.
  • Behavioral Verification Tools - Asserts that specific methods are called with expected arguments, frequencies, and sequences in Ruby applications.
  • Dependency-Mocked Unit Testers - Replaces real objects with test doubles to simulate external dependencies and verify interactions without executing actual production logic.
  • Object Interaction Verification - Validates behavioral contracts by asserting that objects receive expected messages with correct arguments during test execution.
  • Method Stubbing Utilities - Forces methods to return specific values or perform defined actions to manage external dependencies during test execution.
  • Unit Testing Utilities - Isolates code dependencies by replacing real objects with controlled placeholders during automated test execution.
  • Test Double Libraries - Creates test doubles, stubs method calls, and verifies message interactions within Ruby unit testing suites.
  • Legacy Code Testing - Facilitates refactoring by applying method stubs and expectations to existing classes and instances to safely test tightly coupled code.
  • Mock Constant Overriders - Replaces a constant with a specified value during test execution and automatically restores the original value once the test completes.
  • Constant Hiding Utilities - Removes constants from the environment during test execution and automatically restores them to their original state.
  • Instance-Level Injections - Modifies the singleton class of specific object instances to override behavior without affecting the global class definition.
  • Constant Rebinding - Provides mechanisms to temporarily modify global constants during test execution to maintain environment consistency.
  • Method Interception Proxies - Wraps existing object methods with dynamic proxies to intercept calls and inject custom behavior during test execution.
  • Argument Matchers - Constrains expectations to specific argument values or patterns using matchers to ensure methods are invoked with the correct data.
  • Expectation Registries - Maintains a central collection of expected method signatures and call counts to validate behavioral contracts after test completion.
  • Mock Call Order Verifications - Enforces specific sequences of method calls on mock objects to validate complex interaction flows during test execution.
  • Mock Call Count Verification - Allows precise control over the expected number of method invocations, supporting exact, minimum, or maximum call counts.
  • Interface Introspection - Queries the underlying object hierarchy at runtime to verify that stubbed methods exist and match the expected interface.
  • Object Instrumentation - Overrides methods on existing objects to inject test-specific behavior and automatically restores the original implementation after tests.
  • Class-Wide Stubbing - Applies method stubs or message expectations to every instance of a specific class to handle dependencies in complex codebases.
  • Partial Mocks - Verifies that methods stubbed on real objects actually exist, preventing tests from passing against incorrect interfaces.
  • Reproducible Script Generators - Generates self-contained scripts that isolate specific software behaviors or bugs to simplify debugging and reporting.
  • Contract Verifiers - Validates that stubbed methods exist on the underlying object and enforces correct argument counts to ensure test doubles remain synchronized.
  • Null Object Doubles - Provides null object doubles that return themselves for any method call, acting as flexible placeholders that eliminate the need for explicit stubbing.
  • Interaction Spies - Captures method invocation history on objects to enable post-execution verification of behavior using the test spy pattern.
  • Interaction Sequence Orderers - Enforces the required sequence of method calls across mock objects to validate complex interaction flows.

سجل النجوم

مخطط تاريخ النجوم لـ rspec/rspec-mocksمخطط تاريخ النجوم لـ rspec/rspec-mocks

بحث بالذكاء الاصطناعي

استكشف المزيد من المستودعات الرائعة

صف ما تحتاجه بلغة بسيطة — وسيقوم الذكاء الاصطناعي بترتيب آلاف المشاريع مفتوحة المصدر المنسقة حسب الصلة.

Start searching with AI

مجموعات مختارة تضم Rspec Mocks

مجموعات منسقة بعناية يظهر فيها Rspec Mocks.
  • Test isolation tools
  • أداة لاختبار البرمجيات المؤتمت

بدائل مفتوحة المصدر لـ Rspec Mocks

مشاريع مفتوحة المصدر مشابهة، مرتبة حسب عدد الميزات المشتركة مع Rspec Mocks.
  • phpspec/prophecyالصورة الرمزية لـ phpspec

    phpspec/prophecy

    8,480عرض على GitHub↗

    Prophecy is a PHP mocking framework and test double library used to simulate object dependencies during unit testing. It serves as a behavioral testing tool for creating mocks, stubs, and dummies to isolate code and ensure predictable test results. The framework enables interaction verification by tracking method call counts and arguments to validate that specific interactions occurred. It supports defining specific return values or custom logic for method calls to simulate various execution scenarios. The library provides capabilities for argument matching based on type or value, interactio

    PHP
    عرض على GitHub↗8,480
  • rspec/rspec-railsالصورة الرمزية لـ rspec

    rspec/rspec-rails

    5,271عرض على GitHub↗

    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 mo

    Ruby
    عرض على GitHub↗5,271
  • uber-go/mockالصورة الرمزية لـ uber-go

    uber-go/mock

    3,375عرض على GitHub↗

    This project is a framework for generating mock implementations of interfaces to isolate dependencies and verify method interactions during unit testing in Go. It provides tools to simulate external dependencies by creating controlled mock objects, allowing developers to test components in isolation without requiring real service connections. The library distinguishes itself through its use of static interface reflection to generate type-safe mock structures during the build process. It features a fluent assertion API that enables developers to define expected method calls, validate arguments

    Go
    عرض على GitHub↗3,375
  • mockery/mockeryالصورة الرمزية لـ mockery

    mockery/mockery

    10,724عرض على GitHub↗

    Mockery is a PHP framework designed for creating test doubles, stubs, and spies to facilitate isolated unit testing. It serves as a utility for simulating class behavior, intercepting method calls, and validating arguments, allowing developers to replace real dependencies with mock objects to verify that code components interact as intended. The framework distinguishes itself through advanced capabilities for handling complex testing scenarios, such as bypassing constructors, mocking protected methods, and intercepting static calls or internal object instantiations. It provides a fluent inter

    PHPmockmockerymocking
    عرض على GitHub↗10,724
عرض جميع البدائل الـ 30 لـ Rspec Mocks→

الأسئلة الشائعة

ما هي وظيفة rspec/rspec-mocks؟

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.

ما هي الميزات الرئيسية لـ rspec/rspec-mocks؟

الميزات الرئيسية لـ rspec/rspec-mocks هي: Test Environment Mocks, Ruby Testing Frameworks, Automated Test Execution, Method Stubbing, Behavioral Contract Validation, Interaction Expectations, Behavioral Verification Tools, Dependency-Mocked Unit Testers.

ما هي البدائل مفتوحة المصدر لـ rspec/rspec-mocks؟

تشمل البدائل مفتوحة المصدر لـ rspec/rspec-mocks: phpspec/prophecy — Prophecy is a PHP mocking framework and test double library used to simulate object dependencies during unit testing.… rspec/rspec-rails — rspec-rails is a testing framework that integrates RSpec with Ruby on Rails to provide behavior-driven development… uber-go/mock — This project is a framework for generating mock implementations of interfaces to isolate dependencies and verify… mockery/mockery — Mockery is a PHP framework designed for creating test doubles, stubs, and spies to facilitate isolated unit testing.… golang/mock — GoMock is a mocking framework for the Go programming language. moq/moq4 — Moq4 is a .NET mocking framework used to create simulated implementations of interfaces and abstract classes. It…