First, to use RSpec 3, you need a recent version of Ruby. We’ve tested our examples in this book with Ruby 2.4, and encourage you to use that version for the easiest path. You may get slightly different results on other versions of Ruby. If you’re using something older, go to the Ruby download page and grab a newer one.
RSpec is made of three independent Ruby gems:
rspec-core is the overall test harness that runs your specs.
rspec-expectations provides a readable, powerful syntax for checking properties of your code.
rspec-mocks makes it easy to isolate the code you’re testing from the rest of the system.
You can install these individually and mix them with other test frameworks, assertion libraries, and mocking tools. But ...