awesome-repositories.com
博客
MCP
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
bblimke avatar

bblimke/webmock

0
View on GitHub↗
4,050 星标·577 分支·Ruby·MIT·7 次浏览

Webmock

WebMock 是一个用于 HTTP 请求存根、响应模拟和网络拦截的 Ruby 库。它既是一个用于验证传出 HTTP 流量的测试断言框架,也是一个网络拦截层,可阻止外部连接以防止测试期间发生意外请求。

该项目提供了动态响应生成以及为同一端点的重复请求排序不同返回值的功能。它支持模拟网络故障(如超时或异常),并允许使用从本地文件加载的原始 HTTP 数据进行响应重放。

该库涵盖了广泛的 API 模拟和网络控制功能,包括基于 URI 和标头的请求匹配、请求签名记录以及出站流量过滤。它还包括通过自定义回调拦截和记录网络事件的监控实用程序。

Features

  • HTTP Stubbing Frameworks - Implements a comprehensive framework for stubbing HTTP requests and returning predefined status codes and bodies.
  • Ruby - Simulates HTTP server responses to isolate application logic from external network dependencies in Ruby projects.
  • Request Body Matchers - Validates request payloads using regular expressions, partial data structures, or custom logic blocks.
  • Application-Level Traffic Interception - Hooks into Ruby HTTP client libraries to divert outgoing traffic into a custom stub handler.
  • Request History Logs - Captures and stores a history of all intercepted requests to enable post-execution assertions.
  • Ruby HTTP Mocking Libraries - Provides utilities to intercept and simulate HTTP traffic within Ruby applications during testing.
  • API Expectation Frameworks - Provides tools to verify that specific API calls were made with the expected parameters and headers.
  • External API Call Assertions - Verifies that an application made expected outgoing HTTP requests to external services.
  • Custom Mock Response Overrides - Enables the configuration of custom status codes, headers, and bodies to override default mock responses.
  • Request Verification - Asserts that outgoing requests were made, skipped, or executed a specific number of times.
  • Network Connection Blockers - Blocks all external network connections by default to prevent accidental requests during testing.
  • Response Simulators - Generates custom status codes, artificial delays, and specific content types to test application resilience.
  • Network Failure Simulations - Provides simulations of network-level errors such as connection timeouts and service outages to verify application resilience.
  • Regex Request Matching - Allows matching API requests using regular expressions and flexible patterns in URIs and headers.
  • Network Request Assertions - Provides assertions for verifying that specific network requests were executed with expected parameters.
  • Network Request Filters - Uses regular expressions and custom logic to block or allow specific network requests based on URL patterns.
  • HTTP Client Interception - Intercepts outgoing network traffic to block external connections and prevent accidental requests during tests.
  • File-Based Response Serving - Serves the raw contents of local files as mock API response bodies.
  • Dynamic Response Callbacks - Provides custom callback functions to generate mock responses dynamically based on incoming request data.
  • Response Sequencing - Returns a sequence of different responses for repeated requests to the same endpoint.
  • Local API Response Mocking - Loads raw HTTP responses from local files to serve as stubbed return values.
  • Mock State Resetting - Includes utilities to reset request history and clear active stubs between individual test cases.
  • Network Connectivity Controls - Restricts or permits network access to specific hosts during test execution to ensure isolation.
  • Testing - HTTP request stubbing.

Star 历史

bblimke/webmock 的 Star 历史图表bblimke/webmock 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

常见问题解答

bblimke/webmock 是做什么的?

WebMock 是一个用于 HTTP 请求存根、响应模拟和网络拦截的 Ruby 库。它既是一个用于验证传出 HTTP 流量的测试断言框架,也是一个网络拦截层,可阻止外部连接以防止测试期间发生意外请求。

bblimke/webmock 的主要功能有哪些?

bblimke/webmock 的主要功能包括:HTTP Stubbing Frameworks, Ruby, Request Body Matchers, Application-Level Traffic Interception, Request History Logs, Ruby HTTP Mocking Libraries, API Expectation Frameworks, External API Call Assertions。

bblimke/webmock 有哪些开源替代品?

bblimke/webmock 的开源替代品包括: nock/nock — nock is a Node.js HTTP mocking library and request interceptor. It captures outgoing network traffic to specific hosts… getsentry/responses — Responses is a Python mocking library designed to intercept outgoing HTTP calls made with the Requests library to… mock-server/mockserver-monorepo — This project is a multi-protocol API simulation and mocking system designed to replace external dependencies during… alisoftware/ohhttpstubs — OHHTTPStubs is an HTTP network mocking library and request interceptor used to simulate server responses for testing… wheresrhys/fetch-mock — Fetch-mock is a testing utility designed to isolate application code from external network dependencies by… didi/mpx — MPX is a cross-platform framework designed to build applications for multiple mini-program ecosystems and the web from…

Webmock 的开源替代方案

相似的开源项目,按与 Webmock 的功能重合度排序。
  • nock/nocknock 的头像

    nock/nock

    13,103在 GitHub 上查看↗

    nock is a Node.js HTTP mocking library and request interceptor. It captures outgoing network traffic to specific hosts and paths, returning predefined responses to decouple applications from external servers during automated testing. The project functions as an API expectation framework to verify that specific calls were made with correct parameters. It includes a traffic recorder that captures real network interactions as fixtures for playback and a network simulation tool to introduce artificial latency or trigger network errors. Its capabilities cover request matching via hostnames, paths

    JavaScripthttpjavascriptmock
    在 GitHub 上查看↗13,103
  • getsentry/responsesgetsentry 的头像

    getsentry/responses

    4,350在 GitHub 上查看↗

    Responses is a Python mocking library designed to intercept outgoing HTTP calls made with the Requests library to return predefined simulated responses. It functions as a request verification framework and a network simulation tool, allowing for the verification of application behavior against various API response patterns without making real network calls. The project distinguishes itself through a traffic recorder that captures real network interactions and saves them to files for deterministic replay. It further enables the simulation of complex network scenarios, including the triggering

    Pythontag-production
    在 GitHub 上查看↗4,350
  • mock-server/mockserver-monorepoM

    mock-server/mockserver-monorepo

    4,897在 GitHub 上查看↗

    This project is a multi-protocol API simulation and mocking system designed to replace external dependencies during development and testing. It provides an API mocking server, a network traffic proxy, and specialized simulators for language model services and identity providers. The system distinguishes itself through deep AI simulation capabilities, including the emulation of language model providers and Model Context Protocol servers using JSON-RPC 2.0. It supports multi-turn conversational logic, state tracking for AI chat APIs, and the visualization of agent execution through call graphs

    Java
    在 GitHub 上查看↗4,897
  • alisoftware/ohhttpstubsAliSoftware 的头像

    AliSoftware/OHHTTPStubs

    5,068在 GitHub 上查看↗

    OHHTTPStubs is an HTTP network mocking library and request interceptor used to simulate server responses for testing application behavior without a live backend. It functions as a network request stubbing tool that captures outgoing network calls and replaces them with predefined mock data, custom status codes, and headers. The library distinguishes itself through its ability to simulate a wide range of network conditions, including artificial latency and connection failures. It supports dynamic response sequencing, allowing the tool to return a series of different responses for the same requ

    Objective-Ciosmockmock-server
    在 GitHub 上查看↗5,068
  • 查看 Webmock 的所有 30 个替代方案→