Speed Up Your Tests Using VCR Gem in Ruby
01-Mar-2024 598
Since there is a ton of data manipulation involved, I am writing a ton of tests. This is first project in very long time where I am following test-driven development (and I have to say, I'm really enjoying it!). Having a solid backup of tests really gives you the confidence to do a lot of sharp refactorings without constantly worrying if they broke something in some unrelated part of the codebase.However, writing tests with each invocation making an API call can be really slow. To fix this, I started using the stub method in Minitest to fake the API calls. However, that meant creating lots and lots of dummy data manually that's in the same format as returned from the external API.
Speed Up Your Tests Using VCR Gem in Ruby #ruby #rubydeveloper #rubyonrails #Speed #Tests #Using #gem #tests https://rubyonrails.ba/link/speed-up-your-tests-using-vcr-gem-in-ruby