Me
Blog about Ruby, Rails, and more!

Tell Rspec to only show you green dots

2017-08-20

Rspec offers a handful of different formatting options for test output. The default option is to just show the familiar green dots, yellow stars, and red F's with which rspec users are familiar.

However, you can modify the default formatting option in the test suite itself, which means that a user running rspec spec/foo_spec.rb with no formatting option can end up seeing much more output than expected.

Personally, I just want to see green dots, yellow stars, and red F's. You can force rspec back to the default progress bar format by passing the --format progress option when using the CLI.

That command would look like: ruby rspec spec/foo_spec.rb --format progress

Now, assuming that all your tests are passing, you should just see a neat line of green dots.