SaaSHub helps you find the best software and product alternatives Learn more →
Top 23 Ruby Testing Projects
-
faker
A library for generating fake data such as names, addresses, and phone numbers. (by faker-ruby)
rspec-rails factory_bot_rails faker
-
I am going to use a browser based testing tool called Playwright (But you could use Capybara, or Selenium WebDriver etc.).
-
InfluxDB
Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.
-
factory_bot: A fixtures replacement
-
vcr
Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
Basically, it's a record/replay tool, similar to VCR for Ruby, but on steroids and powered by AI (khm GPT khm).
-
If you want to check out an alternative to VCR, have a look at webmock.
-
-
timecop
A gem providing "time travel", "time freezing", and "time acceleration" capabilities, making it simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.
Project mention: What questions do you consider important for a Ruby on Rails technical interview? | /r/rails | 2022-12-05vs https://github.com/travisjeffery/timecop yes it's true and i am happy to show everybody that they don't need timecop in rails test suite anymore.
-
Onboard AI
Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev.
-
-
minitest
minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.
I forgot to mention that reading code is also a good way to learn how to write code, it's like inspiration. Check repos of some gems you like. For example sidekiq https://github.com/sidekiq/sidekiq/tree/main/lib/sidekiq Or minitest https://github.com/minitest/minitest/tree/master/lib/minitest
-
Database Cleaner
Strategies for cleaning databases in Ruby. Can be used to ensure a clean state for testing.
-
-
# Use the Puma web server [https://github.com/puma/puma] gem "puma", "~> 5.0" # Build JSON APIs with ease [https://github.com/rails/jbuilder] # gem "jbuilder" gem 'rack-cors' gem "devise" gem "jsonapi-serializer" gem 'devise-jwt' gem 'active_model_serializers' gem 'followability' gem 'dotenv-rails', groups: [:development, :test, :production] gem 'sprockets' # Use Redis adapter to run Action Cable in production # gem "redis", "~> 4.0" # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] # gem "kredis" # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] # gem "bcrypt", "~> 3.1.7" # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] # Reduces boot times through caching; required in config/boot.rb gem "bootsnap", require: false # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] # gem "image_processing", "~> 1.2" # Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible # gem "rack-cors" group :development, :test do # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem gem "debug", platforms: %i[ mri mingw x64_mingw ] end group :development do gem "sqlite3", "~> 1.4" # Speed up commands on slow machines / big apps [https://github.com/rails/spring] # gem "spring" end group :production do gem 'pg' end
-
-
-
test-kitchen
Test Kitchen is an integration tool for developing and testing infrastructure code and software on isolated target platforms
-
You might be able to do something with https://test-prof.evilmartians.io, but I'm not sure it has anything specific to fixtures out of the box. Maybe using the event profiler on sql.active_record events would be close enough. In the limit, you could wire together your own ActiveSupport::Notifications.instrument around the relevant blocks + an ActiveSupport::Notifications.subscribe to that event so as to log the relevant information. Docs: https://api.rubyonrails.org/classes/ActiveSupport/Notifications.html
-
-
-
-
Spork
A DRb server for testing frameworks (RSpec / Cucumber currently) that forks before each run to ensure a clean testing state.
-
-
If you are used to Mocha for other languages, you can check out Mimic. It lets you define stubs and expectations during tests by keeping track of the stubbed module in an ETS table.
-
Project mention: Tanakai 1.6.0 (web scraping gem) has been released with support to Ruby 3+ | /r/ruby | 2023-02-16
- add support to Apparition and Cuprite
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Ruby Testing related posts
- How to Setup RSpec on a Rails Project
- Ruby's Hash Is a Swiss-Army Knife
- Metaprogramming in Ruby: Advanced Level
- If you use FactoryBot then the FactoryTrace gem might be interesting for you. It keeps your old code removed by finding unused factories & traits. There also was a recent release that made it compatible with all FactoryBot features.
- Do you use FactoryBot? Then FactoryTrace gem is right for you. It helps to find unused factories & traits automatically to keep your old code removed. There was a recent release that made it compatible with all FactoryBot features.
- Do you use FactoryBot? Then you should check out FactoryTrace. It finds unused factories & traits automatically for you to keep your old code removed. I just released 1.1.0, which has an important fix.
- Don't Use Mocks
-
A note from our sponsor - #<SponsorshipServiceOld:0x00007f0f9b9ec6e8>
www.saashub.com | 3 Dec 2023
Index
What are some of the best open-source Testing projects in Ruby? This list will help you:
Project | Stars | |
---|---|---|
1 | faker | 10,959 |
2 | Capybara | 9,892 |
3 | factory_bot | 7,848 |
4 | vcr | 5,678 |
5 | WebMock | 3,834 |
6 | shoulda-matchers | 3,447 |
7 | timecop | 3,301 |
8 | Parallel Tests | 3,288 |
9 | minitest | 3,205 |
10 | Database Cleaner | 2,894 |
11 | RSpec | 2,862 |
12 | Spring | 2,782 |
13 | inspec | 2,757 |
14 | mutant | 1,906 |
15 | test-kitchen | 1,847 |
16 | Ruby Tests Profiling Toolbox | 1,741 |
17 | DuckRails | 1,722 |
18 | ffaker | 1,526 |
19 | Watir | 1,501 |
20 | Spork | 1,402 |
21 | Appraisal | 1,206 |
22 | mocha | 1,181 |
23 | cuprite | 1,156 |