Commit 96fe2a93 authored by Marcia Ramos's avatar Marcia Ramos

Merge branch 'testing-guide-rspec-focused' into 'master'

Add examples on how to run focused rspec

See merge request gitlab-org/gitlab!33345
parents 83e8551f 3565a1d3
......@@ -35,11 +35,18 @@ Here are some things to keep in mind regarding test performance:
To run RSpec tests:
```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
# 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:
......
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