From 40107fd6193256668bb5bcacd9789a3d198f9f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrycja=20Mi=C4=99kina?= Date: Fri, 24 Nov 2023 10:19:57 +0000 Subject: [PATCH 1/2] Configure rspec's --only-failures flag This config stores information about passing/failing tests in examples.txt And allows to run `rspec --only-failures` that only runs the failed tests From the previous run --- spec/dummy-app/spec/spec_helper.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/dummy-app/spec/spec_helper.rb b/spec/dummy-app/spec/spec_helper.rb index ce33d66..4c2115e 100644 --- a/spec/dummy-app/spec/spec_helper.rb +++ b/spec/dummy-app/spec/spec_helper.rb @@ -44,6 +44,11 @@ # triggering implicit auto-inclusion in groups with matching metadata. config.shared_context_metadata_behavior = :apply_to_host_groups + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + # The settings below are suggested to provide a good initial experience # with RSpec, but feel free to customize to your heart's content. =begin @@ -54,10 +59,7 @@ # metadata: `fit`, `fdescribe` and `fcontext`, respectively. config.filter_run_when_matching :focus - # Allows RSpec to persist some state between runs in order to support - # the `--only-failures` and `--next-failure` CLI options. We recommend - # you configure your source control system to ignore this file. - config.example_status_persistence_file_path = "spec/examples.txt" + # Limits the available syntax to the non-monkey patched syntax that is # recommended. For more details, see: From 507c2ad6fa3f89b2c31941dfba805a32169a762b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrycja=20Mi=C4=99kina?= Date: Fri, 24 Nov 2023 13:26:17 +0000 Subject: [PATCH 2/2] Add examples.txt to .gitignore for the gem and the dummy-app --- .gitignore | 3 +++ spec/dummy-app/.gitignore | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index b04a8c8..80cfade 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ # rspec failure tracking .rspec_status + +# Ignore the file recording test run statuses. +spec/dummy-app/spec/examples.txt diff --git a/spec/dummy-app/.gitignore b/spec/dummy-app/.gitignore index 886f714..3eac418 100644 --- a/spec/dummy-app/.gitignore +++ b/spec/dummy-app/.gitignore @@ -33,3 +33,6 @@ # Ignore master key for decrypting credentials and more. /config/master.key + +# Ignore the file recording test run statuses. +/spec/example.txt