ruby
ruby
ruby
How to write custom RSpec matchers in your Ruby on Rails app
Custom RSpec matchers turn repetitive assertions into readable, reusable specs. Step by step: define a matcher with RSpec::Matchers.define, add clear failure messages, build flexible matchers that take arguments, and wire them into your Rails test suite.
ruby
Demystifying and writing own DSL in Ruby by examples - a practical guide
Ruby DSLs demystified by building three of them: a Minitest-like test framework, a Rails-style routes definition, and an RSpec-like spec syntax. See how blocks, instance_eval, and Ruby metaprogramming turn plain classes into a friendly mini-language.
Latest
Finding the slowest tests in Minitest and Rspec using profiler
Slow test suites usually hide a few expensive tests. Minitest and RSpec both ship a built-in profiler: bin/rails test --profile and rspec --profile 10 list your slowest examples with execution times, so you know exactly which tests to optimize first.