Problem: I learned how to run RSpec to test classes and modules in my gem. But, if I wanted to test my gem as if it were already included in a Rails app, I couldn't find much info about it online.
I usually do unit tests with RSpec, and I test the whole stack with Cucumber. So here we will just setup Cucumber to run the Rails app that you embed in your gem.
Before we begin:
- This tutorial is for people who already know how to make gems, and who have used RSpec and Cucumber before in a Rails app.
MyGem
andmy_gem
below refer to the name of the gem we are creating. Replace this with your own name.