In software development, mock objects simulate the behavior and functionality of real objects, often to simplify unit testing. It is an object that mimics the behavior of another object, typically to simplify the testing of a class. A mock object can also be used to simulate how a client will use an API that hasn't yet been built or isn't ready for use. The procedure is a critical element of extreme programming, which relies on frequent releases in short development cycles and emphasizes comprehensive unit testing to ensure application stability. These are the 9 best Ruby Mock libraries in 2022, pact-ruby - Enables consumer-driven contract testing; Mocha - a mocking and stubbing library for Ruby; RSpec's - 'test double' framework, with support for stubbing and mocking; stripe-ruby-mock - A mocking library for testing stripe ruby.
pact-rubyby pact-foundation
Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
pact-rubyby pact-foundation
Ruby
2088
Version:v1.62.0
License: Permissive (MIT)
duckrailsby iridakos
Development tool to mock API endpoints quickly and easily (docker image available)
duckrailsby iridakos
Ruby
1712
Version:v2.1.9
License: Permissive (MIT)
mochaby freerange
Mocha is a mocking and stubbing library for Ruby
mochaby freerange
Ruby
1154
Version:Current
License: Others (Non-SPDX)
rspec-mocksby rspec
RSpec's 'test double' framework, with support for stubbing and mocking
rspec-mocksby rspec
Ruby
1106
Version:v2.14.6
License: Permissive (MIT)
stripe-ruby-mockby stripe-ruby-mock
A mocking library for testing stripe ruby
stripe-ruby-mockby stripe-ruby-mock
Ruby
845
Version:3.1.0.rc2
License: Permissive (MIT)
active_mockerby zeisler
Generate mocks from ActiveRecord models for unit tests that run fast because they don’t need to load Rails or a database.
active_mockerby zeisler
Ruby
497
Version:Current
License: Permissive (MIT)
mock_redisby sds
Mock Redis gem for Ruby
spyby ryanong
A simple opinionated mocking framework. All the features of rspec-mocks and more in half the code.
spyby ryanong
Ruby
126
Version:Current
License: Permissive (MIT)