Rather than testing some intricate production system, let’s imagine something a little more concrete: a sandwich. Yes, it’s silly, but it’ll keep the examples short—plus, we were hungry while writing this chapter.
What’s the most important property of a sandwich? The bread? The condiments? No, the most important thing about a sandwich is that it should taste good. Let’s say so using the language of RSpec.
RSpec uses the words describe and it to express concepts in a conversational format:
Create a new project directory, with a subdirectory called spec. Inside «your_project»/spec, create a file called sandwich_spec.rb with the following contents: