From the course: Ruby: Testing with RSpec

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Running specs

Running specs - Ruby Tutorial

From the course: Ruby: Testing with RSpec

Start my 1-month free trial

Running specs

- In the last movie, we added some examples and expectations to our spec file. Now, we're ready to learn how to actually run those examples using our spec. So, I've already navigated into that project directory. Remember it's very important that we start there. And then from there, we can run the rspec command from the command line, and tell it where the spec is that we want to run. So, it's inside the spec directory and it's called car_spec.rb. So, this will run all of the examples that are in that file. So let's hit return and you'll see the output. Now, let's take a look at the output that it gives us. It gives us a . as output for each one of the examples that it runs successfully. And you can see those are green. That's because we've told color to be on in our configuration, and because it was a pass. Because it passed, it turns it green. It also tells us how long it took to run our test. That's good to know. And it tells us how many total examples, and then, most importantly, 0…

Contents