Before reading this book I've already known RSpec and used it a lot on daily basis in commercial projects, that's why I was even more eager to know what this book could possibly reveal to me. And I must say I was not dissapointed.
First of all, it's written by authors of RSpec, which gave me a feeling that I'm in right hands. With this attitude I started reading this book from the very beginning (even though it states, that current RSpec user can skip first 2 chapters) and I really appreciated doing so - it was good to get used to the author's flow, and gain the consciousness that I indeed know all the stuff (or at least 95%) described there from other sources. The fun part here was to realize what Matchers and Expectations really are - yes, we have diven deep into a Ruby world, so you probably won't be suprised, that they are just a Ruby objects :)
Next, we kick off a simple project written in Sinatra (but it's not required to do any coding) and focus on different parts of it - connecting with the database, sending requests etc., ending on integration tests.
What's more, authors don't only focus on RSpec, rather than convincing you, that you really should:
1. Write specs (not focusing on Rails at all!)
2. Write specs that really test the functionalities you just created
3. You keep away from false positives and other traps that are waiting just behind the corner.
We also get to configuring the RSpec, and we are told which things could be done via command line, and which should be places in actuall config file.
There are some treasures later on, such as using metadata (something like "tags") that for instance let you choose which specs to run - maybe those "tagged" with "fast" or "slow" tag? Or another one, that you partially knew, but only to certain extent. We use "it" a lot, "xit" in 1% of situations, but have you ever heard of "bit" inside your tests? It's really handfull option, that with addition of only one letter before "it" lets you run binding pry in this example! (but this functionality doesn't come out of the box!). Having this in mind, possibilities are almost endless - you can define your own keywords beyond group of "it", "xit" or "bit".
Another neat option is to create your own matchers and expectations, so instead of repetitively witing association chains, you could just define it once and later on refer to this definition, for instance:
expect(art_show).to have_no_tickets_sold
Pretty cool, huh?
But on the other hand, all of those functions can be really hard to understand by other devs at your project who haven't read this book - so bear in mind to let them know before doing this kind of magic ;)
There's a lot to be told about this book, but I would probably ran out of characters allowed by GoodReads to put all my insights about it. I highly recommend this book to all devs!
Last but not least, the book contains the receipt of how to get Nyan cat inside your specs!