Test Your MeetupFinder Class

You’re going to take a break from the back-and-forth cadence of test-driven development to make room for a bit of setup on WebMock. You learned earlier that WebMock helps you write simpler, more useful tests around your calls to the Meetup API. However, to make that happen, you need to add some WebMock-specific configuration to your RSpec setup.

The first step to make WebMock happen is to crack open your spec_helper file and require WebMock’s RSpec module at the top of the file:

 require ​'webmock/rspec'

You’re now ready to define a stub-out-external-API-calls method just for Meetup’s API:

 # call me in a before block anywhere you're calling ...

Get Build Chatbot Interactions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.