Speed Up Your Tests Using VCR Gem in Ruby

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 #gem #tests https://rubyonrails.ba/single/speed-up-your-tests-using-vcr-gem-in-ruby

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles