diff options
author | d-s <ds@voyager.local> | 2023-03-31 22:58:59 +0200 |
---|---|---|
committer | d-s <ds@voyager.local> | 2023-03-31 22:58:59 +0200 |
commit | a949b5012fc626aaec1608c2dc043c1dcc146cf7 (patch) | |
tree | d10be249d7421f45fc7260789060f3569b743092 /content | |
parent | b8488ac4cac9ede57d95e98f2d94251db80e8951 (diff) |
feat: article for 2023-03-31
Diffstat (limited to 'content')
-rw-r--r-- | content/2023/rspec-options.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/content/2023/rspec-options.md b/content/2023/rspec-options.md new file mode 100644 index 0000000..f3ac975 --- /dev/null +++ b/content/2023/rspec-options.md @@ -0,0 +1,21 @@ +--- +title: "Specimen control with RSpec's options" +category: "software" +abstract: RSpec got some cool options for setting what we will test +date: 2023-03-31T22:54:50+02:00 +year: 2023 +draft: false +tags: +- Ruby +- RSpec +- Engineering +--- +Did you know that you can control which tests are run using RSpec's runner options? There are a few options I use every day: + +- `--seed=` - random order of tests is done by generating a random number, a seed. You can force given order by passing in [seed value](https://rubydoc.info/github/rspec/rspec-core/RSpec%2FCore%2FConfiguration:seed). Great for repeating order from CI! +- `--only-failures` - only tests that failed in the previous run will be run. +- `--fail-fast` - stop run after first encountering failure. + +Today I also learned about `--bisect`, which, in a flaky suite, will find the minimal set of tests that will fail the suite. Magic! + +You can find a lot more of such options on [Github](https://github.com/rspec/rspec-core/tree/main/features/command_line). |