Commit 3565a1d3 authored by Thong Kuah's avatar Thong Kuah

Add examples on how to run focused rspec

Warn against running all tests
parent 64edfb5c
...@@ -35,11 +35,18 @@ Here are some things to keep in mind regarding test performance: ...@@ -35,11 +35,18 @@ Here are some things to keep in mind regarding test performance:
To run RSpec tests: To run RSpec tests:
```shell ```shell
# run all tests # run test for a file
bin/rspec spec/models/project_spec.rb
# run test for the example on line 10 on that file
bin/rspec spec/models/project_spec.rb:10
# run tests matching the example name has that string
bin/rspec spec/models/project_spec.rb -e associations
# run all tests, will take hours for GitLab codebase!
bin/rspec bin/rspec
# run test for path
bin/rspec spec/[path]/[to]/[spec].rb
``` ```
Use [Guard](https://github.com/guard/guard) to continuously monitor for changes and only run matching tests: Use [Guard](https://github.com/guard/guard) to continuously monitor for changes and only run matching tests:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment